# Randomizations and Balance Tests
# reading in data (Securing Campus Room for Invited Speaker)
roomdata <- read.csv("C:/Users/khanj/Desktop/Khan_CampusResources_StudyTwo.csv")
roomdata <- as.data.frame(roomdata)

# randomize order of dataset
RNGkind(sample.kind = "Rounding")
set.seed(1578)
roomdata_rand <- roomdata[sample(1:nrow(roomdata)), ]

# creating a new variable, condition
roomdata_rand$condition <- NA

# assigning cases to experimental conditions based on random ordering
roomdata_rand$condition[1:479] <- 'Conservative'
roomdata_rand$condition[480:959] <- 'Control'
roomdata_rand$condition[960:1439] <- 'Liberal'

# Creating new variables for Condition to occupy columns 15, 16, and 17 
roomdata_rand$Liberal <- NA
roomdata_rand$Conservative <- NA
roomdata_rand$Control <- NA

# Column 15: Liberal (Liberal Condition = 1; All other conditions = 0)
roomdata_rand[, 15][roomdata_rand[, 14] == "Conservative"] <- 0
roomdata_rand[, 15][roomdata_rand[, 14] == "Liberal"] <- 1
roomdata_rand[, 15][roomdata_rand[, 14] == "Control"] <- 0

# Column 16: Conservative (Conservative Condition = 1; All other conditions = 0)
roomdata_rand[, 16][roomdata_rand[, 14] == "Conservative"] <- 1
roomdata_rand[, 16][roomdata_rand[, 14] == "Liberal"] <- 0
roomdata_rand[, 16][roomdata_rand[, 14] == "Control"] <- 0

# Column 17: Control (Control Condition = 1; All other conditions = 0)
roomdata_rand[, 17][roomdata_rand[, 14] == "Conservative"] <- 0
roomdata_rand[, 17][roomdata_rand[, 14] == "Liberal"] <- 0
roomdata_rand[, 17][roomdata_rand[, 14] == "Control"] <- 1

# transforming control variables into numeric form
roomdata_rand$enrollment <- as.numeric(roomdata_rand$enrollment)
roomdata_rand$endowment <- as.numeric(roomdata_rand$endowment)
roomdata_rand$ranking <- as.numeric(roomdata_rand$ranking)

# Balance Tests for all emails sent
# Balance Test Model- Liberal
# Any college characteristics predict being in the Liberal Treatment?
liberal_balance <-glm(as.numeric(Liberal) ~ 
                        + I(setting=="urban")
                      + I(setting=="rural")
                      + endowment + enrollment + ranking
                      + I(region=="North") 
                      + I(region=="South") 
                      + I(region=="West") 
                      + I(real_religion==1)
                      + as.factor(num_school_type),
                      data = roomdata_rand, 
                      family = binomial(link = "logit"))

summary(liberal_balance)

# Balance Test Model- Conservative
# Any college characteristics predict being in the Conservative Treatment?
conservative_balance <-glm(as.numeric(Conservative) ~ 
                             + I(setting=="urban")
                           + I(setting=="rural")
                           + endowment + enrollment + ranking
                           + I(region=="North") 
                           + I(region=="South") 
                           + I(region=="West") 
                           + I(real_religion==1)
                           + as.factor(num_school_type),
                           data = roomdata_rand, 
                           family = binomial(link = "logit"))

summary(conservative_balance)

# Balance Test Model- Control
# Any college characteristics predict being in the Control Condition?
control_balance <-glm(as.numeric(Control) ~ I(setting=="urban")
                      + I(setting=="rural")
                      + endowment + enrollment + ranking
                      + I(region=="North") 
                      + I(region=="South") 
                      + I(region=="West") 
                      + I(real_religion==1)
                      + as.factor(num_school_type),
                      data = roomdata_rand, 
                      family = binomial(link = "logit"))

summary(control_balance)

# Balance Test/ Equivalency Check Tables- All Emails Sent
# Liberal- All Emails Sent 
library(Hmisc)
Variables <- matrix(NA, 13 ,3)
colnames(Variables) <- c("Coefficient", "Std. Error", "p-value")
rownames(Variables) <- c("Intercept","urban","rural", "endowment", "enrollment", 
                         "ranking", "North", "South", "West",
                         "religious", "National Liberal Arts",
                         "Regional Universities", "Regional Colleges") 
Variables[ ,1] <- round(as.numeric(liberal_balance$coefficients), digits = 2)
Variables[ ,2] <- round(summary(liberal_balance)$coefficients[ ,2], digits = 2)
Variables[ ,3] <- round(summary(liberal_balance)$coefficients[ ,4], digits = 2)
latex(Variables, file = "")

# Balance Test/ Equivalency Check Tables
# Conservative- All Emails Sent
library(Hmisc)
Variables <- matrix(NA, 13 ,3)
colnames(Variables) <- c("Coefficient", "Std. Error", "p-value")
rownames(Variables) <- c("Intercept","urban","rural", "endowment", "enrollment", 
                         "ranking", "North", "South", "West",
                         "religious", "National Liberal Arts",
                         "Regional Universities", "Regional Colleges") 
Variables[ ,1] <- round(as.numeric(conservative_balance$coefficients), digits = 2)
Variables[ ,2] <- round(summary(conservative_balance)$coefficients[ ,2], digits = 2)
Variables[ ,3] <- round(summary(conservative_balance)$coefficients[ ,4], digits = 2)
latex(Variables, file = "")

# Balance Test/ Equivalency Check Tables
# Control- All Emails Sent 
library(Hmisc)
Variables <- matrix(NA, 13 ,3)
colnames(Variables) <- c("Coefficient", "Std. Error", "p-value")
rownames(Variables) <- c("Intercept","urban","rural", "endowment", "enrollment", 
                         "ranking", "North", "South", "West",
                         "religious", "National Liberal Arts",
                         "Regional Universities", "Regional Colleges") 
Variables[ ,1] <- round(as.numeric(control_balance$coefficients), digits = 2)
Variables[ ,2] <- round(summary(control_balance)$coefficients[ ,2], digits = 2)
Variables[ ,3] <- round(summary(control_balance)$coefficients[ ,4], digits = 2)
latex(Variables, file = "")

# creating a new variable, day sent
roomdata_rand$day_sent <- NA

# randomize order of dataset for day sent/chronological order
RNGkind(sample.kind = "Rounding")
set.seed(1031)
roomdata_rand <- roomdata_rand[sample(1:nrow(roomdata_rand)), ]

# creating a new variable, day sent
roomdata_rand$day_sent <- NA

# assigning emails to be sent in random order 
roomdata_rand$day_sent[1:479] <- 'Wednesday'
roomdata_rand$day_sent[480:959] <- 'Thursday'
roomdata_rand$day_sent[960:1439]  <- 'Friday'

# creating a new variable, reply
roomdata_rand$reply <- 0

# Reply at all
roomdata_rand$reply[2] <- 1
roomdata_rand$reply[3] <- 1
roomdata_rand$reply[9] <- 1
roomdata_rand$reply[11] <- 1
roomdata_rand$reply[12] <- 1
roomdata_rand$reply[14] <- 1
roomdata_rand$reply[15] <- 1
roomdata_rand$reply[16] <- 1
roomdata_rand$reply[19] <- 1
roomdata_rand$reply[20] <- 1
roomdata_rand$reply[21] <- 1
roomdata_rand$reply[22] <- 1
roomdata_rand$reply[24] <- 1
roomdata_rand$reply[25] <- NA
roomdata_rand$reply[27] <- 1
roomdata_rand$reply[28] <- 1
roomdata_rand$reply[29] <- 1
roomdata_rand$reply[31] <- 1
roomdata_rand$reply[33] <- NA
roomdata_rand$reply[34] <- 1
roomdata_rand$reply[36] <- NA
roomdata_rand$reply[38] <- 1
roomdata_rand$reply[39] <- 1
roomdata_rand$reply[41] <- 1
roomdata_rand$reply[45] <- 1
roomdata_rand$reply[47] <- 1
roomdata_rand$reply[49] <- 1
roomdata_rand$reply[50] <- 1
roomdata_rand$reply[52] <- 1
roomdata_rand$reply[53] <- 1
roomdata_rand$reply[56] <- 1
roomdata_rand$reply[59] <- 1
roomdata_rand$reply[62] <- 1
roomdata_rand$reply[64] <- 1
roomdata_rand$reply[65] <- 1
roomdata_rand$reply[69] <- 1
roomdata_rand$reply[70] <- 1
roomdata_rand$reply[71] <- 1
roomdata_rand$reply[73] <- 1
roomdata_rand$reply[74] <- 1
roomdata_rand$reply[77] <- 1
roomdata_rand$reply[79] <- 1
roomdata_rand$reply[82] <- 1
roomdata_rand$reply[83] <- 1
roomdata_rand$reply[84] <- 1
roomdata_rand$reply[85] <- 1
roomdata_rand$reply[87] <- 1
roomdata_rand$reply[88] <- 1
roomdata_rand$reply[89] <- 1
roomdata_rand$reply[90] <- NA
roomdata_rand$reply[92] <- 1
roomdata_rand$reply[95] <- 1
roomdata_rand$reply[97] <- 1
roomdata_rand$reply[98] <- 1
roomdata_rand$reply[99] <- 1
roomdata_rand$reply[102] <- 1
roomdata_rand$reply[103] <- 1
roomdata_rand$reply[104] <- 1
roomdata_rand$reply[105] <- 1
roomdata_rand$reply[106] <- 1
roomdata_rand$reply[107] <- 1
roomdata_rand$reply[110] <- 1
roomdata_rand$reply[111] <- 1
roomdata_rand$reply[112] <- 1
roomdata_rand$reply[113] <- 1
roomdata_rand$reply[115] <- 1
roomdata_rand$reply[117] <- 1
roomdata_rand$reply[120] <- 1
roomdata_rand$reply[122] <- 1
roomdata_rand$reply[123] <- 1
roomdata_rand$reply[124] <- 1
roomdata_rand$reply[125] <- 1
roomdata_rand$reply[127] <- 1
roomdata_rand$reply[128] <- 1
roomdata_rand$reply[129] <- 1
roomdata_rand$reply[131] <- 1
roomdata_rand$reply[134] <- 1
roomdata_rand$reply[136] <- 1
roomdata_rand$reply[137] <- 1
roomdata_rand$reply[139] <- 1
roomdata_rand$reply[141] <- NA
roomdata_rand$reply[145] <- 1
roomdata_rand$reply[146] <- 1
roomdata_rand$reply[148] <- 1
roomdata_rand$reply[149] <- 1
roomdata_rand$reply[150] <- 1
roomdata_rand$reply[151] <- 1
roomdata_rand$reply[152] <- 1
roomdata_rand$reply[153] <- 1
roomdata_rand$reply[154] <- 1
roomdata_rand$reply[156] <- 1
roomdata_rand$reply[159] <- 1
roomdata_rand$reply[160] <- 1
roomdata_rand$reply[161] <- 1
roomdata_rand$reply[162] <- 1
roomdata_rand$reply[164] <- 1
roomdata_rand$reply[166] <- NA
roomdata_rand$reply[167] <- 1
roomdata_rand$reply[168] <- 1
roomdata_rand$reply[169] <- 1
roomdata_rand$reply[170] <- 1
roomdata_rand$reply[172] <- 1
roomdata_rand$reply[174] <- 1
roomdata_rand$reply[176] <- 1
roomdata_rand$reply[178] <- 1
roomdata_rand$reply[181] <- NA
roomdata_rand$reply[182] <- 1
roomdata_rand$reply[184] <- 1
roomdata_rand$reply[185] <- 1
roomdata_rand$reply[186] <- 1
roomdata_rand$reply[188] <- 1
roomdata_rand$reply[189] <- 1
roomdata_rand$reply[190] <- 1
roomdata_rand$reply[192] <- 1
roomdata_rand$reply[193] <- 1
roomdata_rand$reply[194] <- 1
roomdata_rand$reply[197] <- NA
roomdata_rand$reply[198] <- 1
roomdata_rand$reply[199] <- 1
roomdata_rand$reply[200] <- 1
roomdata_rand$reply[201] <- NA
roomdata_rand$reply[202] <- 1
roomdata_rand$reply[204] <- 1
roomdata_rand$reply[205] <- 1
roomdata_rand$reply[206] <- 1
roomdata_rand$reply[207] <- 1
roomdata_rand$reply[208] <- 1
roomdata_rand$reply[210] <- 1
roomdata_rand$reply[211] <- 1
roomdata_rand$reply[213] <- 1
roomdata_rand$reply[215] <- 1
roomdata_rand$reply[216] <- 1
roomdata_rand$reply[217] <- 1
roomdata_rand$reply[219] <- 1
roomdata_rand$reply[220] <- 1
roomdata_rand$reply[221] <- 1
roomdata_rand$reply[225] <- 1
roomdata_rand$reply[227] <- 1
roomdata_rand$reply[228] <- 1
roomdata_rand$reply[229] <- NA
roomdata_rand$reply[230] <- 1
roomdata_rand$reply[233] <- 1
roomdata_rand$reply[234] <- 1
roomdata_rand$reply[235] <- 1
roomdata_rand$reply[236] <- 1
roomdata_rand$reply[237] <- 1
roomdata_rand$reply[238] <- 1
roomdata_rand$reply[239] <- 1
roomdata_rand$reply[240] <- NA
roomdata_rand$reply[244] <- 1
roomdata_rand$reply[249] <- 1
roomdata_rand$reply[255] <- NA
roomdata_rand$reply[256] <- NA
roomdata_rand$reply[262] <- NA
roomdata_rand$reply[263] <- NA
roomdata_rand$reply[264] <- 1
roomdata_rand$reply[265] <- 1
roomdata_rand$reply[266] <- 1
roomdata_rand$reply[268] <- 1
roomdata_rand$reply[269] <- 1
roomdata_rand$reply[272] <- 1
roomdata_rand$reply[274] <- 1
roomdata_rand$reply[275] <- 1
roomdata_rand$reply[276] <- 1
roomdata_rand$reply[278] <- 1
roomdata_rand$reply[279] <- 1
roomdata_rand$reply[280] <- 1
roomdata_rand$reply[281] <- 1
roomdata_rand$reply[282] <- 1
roomdata_rand$reply[283] <- 1
roomdata_rand$reply[284] <- 1
roomdata_rand$reply[285] <- 1
roomdata_rand$reply[286] <- 1
roomdata_rand$reply[288] <- 1
roomdata_rand$reply[289] <- 1
roomdata_rand$reply[292] <- 1
roomdata_rand$reply[293] <- 1
roomdata_rand$reply[294] <- 1
roomdata_rand$reply[295] <- 1
roomdata_rand$reply[296] <- 1
roomdata_rand$reply[297] <- 1
roomdata_rand$reply[299] <- 1
roomdata_rand$reply[301] <- 1
roomdata_rand$reply[303] <- NA
roomdata_rand$reply[305] <- 1
roomdata_rand$reply[306] <- 1
roomdata_rand$reply[307] <- 1
roomdata_rand$reply[308] <- 1
roomdata_rand$reply[310] <- 1
roomdata_rand$reply[311] <- 1
roomdata_rand$reply[315] <- 1
roomdata_rand$reply[316] <- NA
roomdata_rand$reply[317] <- 1
roomdata_rand$reply[322] <- 1
roomdata_rand$reply[323] <- 1
roomdata_rand$reply[324] <- 1
roomdata_rand$reply[325] <- 1
roomdata_rand$reply[329] <- 1
roomdata_rand$reply[330] <- 1
roomdata_rand$reply[334] <- 1
roomdata_rand$reply[335] <- 1
roomdata_rand$reply[336] <- 1
roomdata_rand$reply[338] <- 1
roomdata_rand$reply[340] <- 1
roomdata_rand$reply[341] <- 1
roomdata_rand$reply[342] <- 1
roomdata_rand$reply[343] <- 1
roomdata_rand$reply[344] <- 1
roomdata_rand$reply[347] <- 1
roomdata_rand$reply[349] <- 1
roomdata_rand$reply[350] <- 1
roomdata_rand$reply[351] <- 1
roomdata_rand$reply[354] <- 1
roomdata_rand$reply[355] <- 1
roomdata_rand$reply[356] <- 1
roomdata_rand$reply[357] <- 1
roomdata_rand$reply[361] <- 1
roomdata_rand$reply[362] <- 1
roomdata_rand$reply[363] <- 1
roomdata_rand$reply[367] <- 1
roomdata_rand$reply[368] <- 1
roomdata_rand$reply[369] <- 1
roomdata_rand$reply[370] <- 1
roomdata_rand$reply[371] <- 1
roomdata_rand$reply[372] <- 1
roomdata_rand$reply[373] <- 1
roomdata_rand$reply[374] <- 1
roomdata_rand$reply[376] <- NA
roomdata_rand$reply[379] <- 1
roomdata_rand$reply[380] <- NA
roomdata_rand$reply[382] <- 1
roomdata_rand$reply[383] <- 1
roomdata_rand$reply[385] <- 1
roomdata_rand$reply[387] <- 1
roomdata_rand$reply[390] <- 1
roomdata_rand$reply[391] <- 1
roomdata_rand$reply[392] <- 1
roomdata_rand$reply[393] <- 1
roomdata_rand$reply[394] <- 1
roomdata_rand$reply[395] <- 1
roomdata_rand$reply[396] <- 1
roomdata_rand$reply[397] <- 1
roomdata_rand$reply[401] <- 1
roomdata_rand$reply[404] <- 1
roomdata_rand$reply[405] <- NA
roomdata_rand$reply[408] <- NA
roomdata_rand$reply[411] <- 1
roomdata_rand$reply[414] <- 1
roomdata_rand$reply[415] <- 1
roomdata_rand$reply[416] <- 1
roomdata_rand$reply[417] <- 1
roomdata_rand$reply[419] <- 1
roomdata_rand$reply[420] <- 1
roomdata_rand$reply[425] <- 1
roomdata_rand$reply[426] <- 1
roomdata_rand$reply[428] <- 1
roomdata_rand$reply[430] <- 1
roomdata_rand$reply[431] <- 1
roomdata_rand$reply[432] <- 1
roomdata_rand$reply[433] <- 1
roomdata_rand$reply[436] <- 1
roomdata_rand$reply[439] <- 1
roomdata_rand$reply[440] <- NA
roomdata_rand$reply[441] <- 1
roomdata_rand$reply[444] <- 1
roomdata_rand$reply[445] <- 1
roomdata_rand$reply[446] <- 1
roomdata_rand$reply[447] <- 1
roomdata_rand$reply[449] <- 1
roomdata_rand$reply[450] <- 1
roomdata_rand$reply[452] <- 1
roomdata_rand$reply[453] <- 1
roomdata_rand$reply[454] <- 1
roomdata_rand$reply[457] <- 1
roomdata_rand$reply[459] <- 1
roomdata_rand$reply[461] <- 1
roomdata_rand$reply[464] <- 1
roomdata_rand$reply[466] <- 1
roomdata_rand$reply[469] <- NA
roomdata_rand$reply[470] <- 1
roomdata_rand$reply[471] <- 1
roomdata_rand$reply[473] <- 1
roomdata_rand$reply[474] <- NA
roomdata_rand$reply[477] <- 1
roomdata_rand$reply[482] <- 1
roomdata_rand$reply[483] <- 1
roomdata_rand$reply[486] <- 1
roomdata_rand$reply[489] <- 1
roomdata_rand$reply[490] <- 1
roomdata_rand$reply[491] <- 1
roomdata_rand$reply[494] <- 1
roomdata_rand$reply[501] <- 1
roomdata_rand$reply[503] <- 1
roomdata_rand$reply[505] <- 1
roomdata_rand$reply[506] <- 1
roomdata_rand$reply[507] <- 1
roomdata_rand$reply[509] <- 1
roomdata_rand$reply[512] <- 1
roomdata_rand$reply[513] <- 1
roomdata_rand$reply[518] <- 1
roomdata_rand$reply[519] <- 1
roomdata_rand$reply[520] <- NA
roomdata_rand$reply[522] <- 1
roomdata_rand$reply[523] <- 1
roomdata_rand$reply[525] <- 1
roomdata_rand$reply[526] <- 1
roomdata_rand$reply[532] <- NA
roomdata_rand$reply[533] <- 1
roomdata_rand$reply[534] <- 1
roomdata_rand$reply[535] <- 1
roomdata_rand$reply[536] <- 1
roomdata_rand$reply[537] <- 1
roomdata_rand$reply[538] <- 1
roomdata_rand$reply[540] <- 1
roomdata_rand$reply[541] <- 1
roomdata_rand$reply[542] <- 1
roomdata_rand$reply[543] <- 1
roomdata_rand$reply[545] <- 1
roomdata_rand$reply[546] <- 1
roomdata_rand$reply[550] <- 1
roomdata_rand$reply[551] <- 1
roomdata_rand$reply[552] <- 1
roomdata_rand$reply[554] <- 1
roomdata_rand$reply[555] <- 1
roomdata_rand$reply[556] <- 1
roomdata_rand$reply[558] <- NA
roomdata_rand$reply[560] <- 1
roomdata_rand$reply[563] <- 1
roomdata_rand$reply[564] <- NA
roomdata_rand$reply[565] <- 1
roomdata_rand$reply[568] <- 1
roomdata_rand$reply[569] <- 1
roomdata_rand$reply[570] <- 1
roomdata_rand$reply[571] <- 1
roomdata_rand$reply[574] <- 1
roomdata_rand$reply[575] <- 1
roomdata_rand$reply[578] <- 1
roomdata_rand$reply[579] <- 1
roomdata_rand$reply[580] <- 1
roomdata_rand$reply[582] <- 1
roomdata_rand$reply[583] <- 1
roomdata_rand$reply[586] <- 1
roomdata_rand$reply[587] <- 1
roomdata_rand$reply[588] <- 1
roomdata_rand$reply[593] <- 1
roomdata_rand$reply[596] <- NA
roomdata_rand$reply[597] <- 1
roomdata_rand$reply[600] <- 1
roomdata_rand$reply[604] <- 1
roomdata_rand$reply[610] <- 1
roomdata_rand$reply[611] <- 1
roomdata_rand$reply[617] <- 1
roomdata_rand$reply[620] <- 1
roomdata_rand$reply[621] <- NA
roomdata_rand$reply[627] <- 1
roomdata_rand$reply[628] <- 1
roomdata_rand$reply[629] <- 1
roomdata_rand$reply[630] <- 1
roomdata_rand$reply[631] <- 1
roomdata_rand$reply[632] <- 1
roomdata_rand$reply[638] <- 1
roomdata_rand$reply[639] <- 1
roomdata_rand$reply[640] <- 1
roomdata_rand$reply[641] <- 1
roomdata_rand$reply[642] <- 1
roomdata_rand$reply[644] <- 1
roomdata_rand$reply[645] <- 1
roomdata_rand$reply[646] <- 1
roomdata_rand$reply[648] <- 1
roomdata_rand$reply[649] <- 1
roomdata_rand$reply[650] <- 1
roomdata_rand$reply[653] <- 1
roomdata_rand$reply[655] <- 1
roomdata_rand$reply[656] <- 1
roomdata_rand$reply[661] <- 1
roomdata_rand$reply[663] <- 1
roomdata_rand$reply[664] <- 1
roomdata_rand$reply[665] <- 1
roomdata_rand$reply[667] <- 1
roomdata_rand$reply[668] <- 1
roomdata_rand$reply[669] <- 1
roomdata_rand$reply[670] <- 1
roomdata_rand$reply[672] <- 1
roomdata_rand$reply[673] <- 1
roomdata_rand$reply[677] <- 1
roomdata_rand$reply[680] <- NA
roomdata_rand$reply[681] <- 1
roomdata_rand$reply[682] <- 1
roomdata_rand$reply[684] <- 1
roomdata_rand$reply[687] <- 1
roomdata_rand$reply[688] <- 1
roomdata_rand$reply[689] <- 1
roomdata_rand$reply[692] <- 1
roomdata_rand$reply[693] <- 1
roomdata_rand$reply[694] <- 1
roomdata_rand$reply[697] <- NA
roomdata_rand$reply[698] <- 1
roomdata_rand$reply[699] <- 1
roomdata_rand$reply[700] <- 1
roomdata_rand$reply[703] <- 1
roomdata_rand$reply[704] <- 1
roomdata_rand$reply[705] <- 1
roomdata_rand$reply[709] <- 1
roomdata_rand$reply[710] <- 1
roomdata_rand$reply[711] <- 1
roomdata_rand$reply[712] <- NA
roomdata_rand$reply[713] <- 1
roomdata_rand$reply[716] <- 1
roomdata_rand$reply[717] <- 1
roomdata_rand$reply[718] <- 1
roomdata_rand$reply[720] <- NA
roomdata_rand$reply[721] <- 1
roomdata_rand$reply[723] <- 1
roomdata_rand$reply[725] <- 1
roomdata_rand$reply[727] <- 1
roomdata_rand$reply[730] <- 1
roomdata_rand$reply[731] <- 1
roomdata_rand$reply[733] <- NA
roomdata_rand$reply[734] <- 1
roomdata_rand$reply[735] <- 1
roomdata_rand$reply[736] <- 1
roomdata_rand$reply[737] <- 1
roomdata_rand$reply[738] <- NA
roomdata_rand$reply[740] <- 1
roomdata_rand$reply[742] <- 1
roomdata_rand$reply[743] <- NA
roomdata_rand$reply[749] <- NA
roomdata_rand$reply[750] <- 1
roomdata_rand$reply[751] <- 1
roomdata_rand$reply[754] <- 1
roomdata_rand$reply[759] <- NA
roomdata_rand$reply[760] <- 1
roomdata_rand$reply[761] <- 1
roomdata_rand$reply[763] <- 1
roomdata_rand$reply[764] <- 1
roomdata_rand$reply[765] <- NA
roomdata_rand$reply[767] <- NA
roomdata_rand$reply[768] <- 1
roomdata_rand$reply[769] <- 1
roomdata_rand$reply[772] <- 1
roomdata_rand$reply[773] <- 1
roomdata_rand$reply[774] <- 1
roomdata_rand$reply[776] <- 1
roomdata_rand$reply[777] <- 1
roomdata_rand$reply[778] <- 1
roomdata_rand$reply[779] <- 1
roomdata_rand$reply[782] <- 1
roomdata_rand$reply[786] <- 1
roomdata_rand$reply[788] <- 1
roomdata_rand$reply[789] <- 1
roomdata_rand$reply[790] <- 1
roomdata_rand$reply[791] <- 1
roomdata_rand$reply[792] <- 1
roomdata_rand$reply[793] <- 1
roomdata_rand$reply[794] <- 1
roomdata_rand$reply[795] <- 1
roomdata_rand$reply[796] <- 1
roomdata_rand$reply[797] <- 1
roomdata_rand$reply[798] <- 1
roomdata_rand$reply[799] <- 1
roomdata_rand$reply[800] <- 1
roomdata_rand$reply[801] <- NA
roomdata_rand$reply[802] <- 1
roomdata_rand$reply[803] <- 1
roomdata_rand$reply[804] <- 1
roomdata_rand$reply[805] <- 1
roomdata_rand$reply[808] <- 1
roomdata_rand$reply[810] <- 1
roomdata_rand$reply[813] <- 1
roomdata_rand$reply[814] <- 1
roomdata_rand$reply[815] <- 1
roomdata_rand$reply[816] <- 1
roomdata_rand$reply[819] <- 1
roomdata_rand$reply[820] <- 1
roomdata_rand$reply[821] <- 1
roomdata_rand$reply[822] <- 1
roomdata_rand$reply[823] <- 1
roomdata_rand$reply[824] <- 1
roomdata_rand$reply[826] <- NA
roomdata_rand$reply[827] <- 1
roomdata_rand$reply[828] <- 1
roomdata_rand$reply[830] <- 1
roomdata_rand$reply[831] <- NA
roomdata_rand$reply[837] <- 1
roomdata_rand$reply[841] <- 1
roomdata_rand$reply[842] <- 1
roomdata_rand$reply[843] <- NA
roomdata_rand$reply[845] <- 1
roomdata_rand$reply[846] <- 1
roomdata_rand$reply[847] <- 1
roomdata_rand$reply[848] <- 1
roomdata_rand$reply[849] <- 1
roomdata_rand$reply[851] <- NA
roomdata_rand$reply[852] <- NA
roomdata_rand$reply[853] <- NA
roomdata_rand$reply[854] <- NA
roomdata_rand$reply[855] <- NA
roomdata_rand$reply[856] <- NA
roomdata_rand$reply[858] <- 1
roomdata_rand$reply[861] <- 1
roomdata_rand$reply[863] <- 1
roomdata_rand$reply[865] <- 1
roomdata_rand$reply[866] <- NA
roomdata_rand$reply[867] <- NA
roomdata_rand$reply[868] <- 1
roomdata_rand$reply[873] <- 1
roomdata_rand$reply[874] <- 1
roomdata_rand$reply[875] <- 1
roomdata_rand$reply[877] <- 1
roomdata_rand$reply[878] <- 1
roomdata_rand$reply[879] <- 1
roomdata_rand$reply[880] <- 1
roomdata_rand$reply[881] <- 1
roomdata_rand$reply[887] <- 1
roomdata_rand$reply[888] <- 1
roomdata_rand$reply[889] <- 1
roomdata_rand$reply[890] <- 1
roomdata_rand$reply[891] <- 1
roomdata_rand$reply[892] <- 1
roomdata_rand$reply[894] <- 1
roomdata_rand$reply[895] <- NA
roomdata_rand$reply[896] <- NA
roomdata_rand$reply[897] <- NA
roomdata_rand$reply[900] <- NA
roomdata_rand$reply[901] <- NA
roomdata_rand$reply[902] <- 1
roomdata_rand$reply[904] <- 1
roomdata_rand$reply[905] <- 1
roomdata_rand$reply[906] <- 1
roomdata_rand$reply[908] <- 1
roomdata_rand$reply[909] <- 1
roomdata_rand$reply[912] <- 1
roomdata_rand$reply[913] <- 1
roomdata_rand$reply[915] <- NA
roomdata_rand$reply[916] <- 1
roomdata_rand$reply[917] <- 1
roomdata_rand$reply[920] <- 1
roomdata_rand$reply[925] <- 1
roomdata_rand$reply[926] <- 1
roomdata_rand$reply[928] <- 1
roomdata_rand$reply[929] <- 1
roomdata_rand$reply[931] <- NA
roomdata_rand$reply[932] <- 1
roomdata_rand$reply[935] <- 1
roomdata_rand$reply[936] <- 1
roomdata_rand$reply[937] <- 1
roomdata_rand$reply[938] <- 1
roomdata_rand$reply[939] <- 1
roomdata_rand$reply[940] <- 1
roomdata_rand$reply[941] <- 1
roomdata_rand$reply[949] <- 1
roomdata_rand$reply[950] <- 1
roomdata_rand$reply[952] <- NA
roomdata_rand$reply[955] <- 1
roomdata_rand$reply[957] <- 1
roomdata_rand$reply[958] <- 1
roomdata_rand$reply[959] <- 1
roomdata_rand$reply[964] <- 1
roomdata_rand$reply[965] <- 1
roomdata_rand$reply[966] <- 1
roomdata_rand$reply[969] <- 1
roomdata_rand$reply[970] <- 1
roomdata_rand$reply[971] <- 1
roomdata_rand$reply[972] <- 1
roomdata_rand$reply[973] <- 1
roomdata_rand$reply[974] <- NA
roomdata_rand$reply[976] <- 1
roomdata_rand$reply[979] <- 1
roomdata_rand$reply[980] <- 1
roomdata_rand$reply[982] <- 1
roomdata_rand$reply[986] <- 1
roomdata_rand$reply[988] <- NA
roomdata_rand$reply[997] <- NA
roomdata_rand$reply[1000] <- 1
roomdata_rand$reply[1001] <- 1
roomdata_rand$reply[1002] <- 1
roomdata_rand$reply[1004] <- 1
roomdata_rand$reply[1005] <- 1
roomdata_rand$reply[1006] <- 1
roomdata_rand$reply[1008] <- 1
roomdata_rand$reply[1010] <- 1
roomdata_rand$reply[1011] <- 1
roomdata_rand$reply[1013] <- 1
roomdata_rand$reply[1014] <- 1
roomdata_rand$reply[1015] <- 1
roomdata_rand$reply[1017] <- 1
roomdata_rand$reply[1020] <- 1
roomdata_rand$reply[1023] <- 1
roomdata_rand$reply[1025] <- 1
roomdata_rand$reply[1026] <- NA
roomdata_rand$reply[1027] <- NA
roomdata_rand$reply[1030] <- 1
roomdata_rand$reply[1031] <- 1
roomdata_rand$reply[1032] <- 1
roomdata_rand$reply[1033] <- 1
roomdata_rand$reply[1036] <- 1
roomdata_rand$reply[1037] <- 1
roomdata_rand$reply[1038] <- 1
roomdata_rand$reply[1039] <- 1
roomdata_rand$reply[1040] <- 1
roomdata_rand$reply[1042] <- 1
roomdata_rand$reply[1044] <- 1
roomdata_rand$reply[1045] <- 1
roomdata_rand$reply[1046] <- 1
roomdata_rand$reply[1048] <- NA
roomdata_rand$reply[1049] <- 1
roomdata_rand$reply[1050] <- 1
roomdata_rand$reply[1051] <- 1
roomdata_rand$reply[1052] <- 1
roomdata_rand$reply[1055] <- 1
roomdata_rand$reply[1059] <- 1
roomdata_rand$reply[1063] <- 1
roomdata_rand$reply[1064] <- 1
roomdata_rand$reply[1065] <- 1
roomdata_rand$reply[1066] <- NA
roomdata_rand$reply[1067] <- 1
roomdata_rand$reply[1068] <- 1
roomdata_rand$reply[1071] <- NA
roomdata_rand$reply[1074] <- 1
roomdata_rand$reply[1075] <- 1
roomdata_rand$reply[1076] <- 1
roomdata_rand$reply[1079] <- 1
roomdata_rand$reply[1080] <- 1
roomdata_rand$reply[1083] <- 1
roomdata_rand$reply[1085] <- 1
roomdata_rand$reply[1089] <- 1
roomdata_rand$reply[1090] <- 1
roomdata_rand$reply[1091] <- 1
roomdata_rand$reply[1092] <- 1
roomdata_rand$reply[1094] <- 1
roomdata_rand$reply[1096] <- 1
roomdata_rand$reply[1098] <- 1
roomdata_rand$reply[1100] <- 1
roomdata_rand$reply[1101] <- 1
roomdata_rand$reply[1102] <- 1
roomdata_rand$reply[1103] <- 1
roomdata_rand$reply[1104] <- 1
roomdata_rand$reply[1105] <- 1
roomdata_rand$reply[1108] <- 1
roomdata_rand$reply[1109] <- 1
roomdata_rand$reply[1110] <- 1
roomdata_rand$reply[1114] <- NA
roomdata_rand$reply[1117] <- 1
roomdata_rand$reply[1118] <- 1
roomdata_rand$reply[1119] <- 1
roomdata_rand$reply[1121] <- NA
roomdata_rand$reply[1122] <- 1
roomdata_rand$reply[1124] <- 1
roomdata_rand$reply[1125] <- NA
roomdata_rand$reply[1126] <- 1
roomdata_rand$reply[1127] <- 1
roomdata_rand$reply[1130] <- 1
roomdata_rand$reply[1131] <- 1
roomdata_rand$reply[1132] <- 1
roomdata_rand$reply[1134] <- 1
roomdata_rand$reply[1135] <- 1
roomdata_rand$reply[1136] <- 1
roomdata_rand$reply[1137] <- 1
roomdata_rand$reply[1140] <- 1
roomdata_rand$reply[1141] <- 1
roomdata_rand$reply[1144] <- 1
roomdata_rand$reply[1145] <- 1
roomdata_rand$reply[1147] <- 1
roomdata_rand$reply[1148] <- 1
roomdata_rand$reply[1149] <- 1
roomdata_rand$reply[1150] <- 1
roomdata_rand$reply[1151] <- 1
roomdata_rand$reply[1152] <- 1
roomdata_rand$reply[1153] <- 1
roomdata_rand$reply[1155] <- 1
roomdata_rand$reply[1160] <- 1
roomdata_rand$reply[1161] <- 1
roomdata_rand$reply[1163] <- 1
roomdata_rand$reply[1164] <- 1
roomdata_rand$reply[1165] <- 1
roomdata_rand$reply[1166] <- 1
roomdata_rand$reply[1167] <- 1
roomdata_rand$reply[1168] <- 1
roomdata_rand$reply[1170] <- 1
roomdata_rand$reply[1171] <- 1
roomdata_rand$reply[1173] <- 1
roomdata_rand$reply[1174] <- 1
roomdata_rand$reply[1178] <- 1
roomdata_rand$reply[1180] <- 1
roomdata_rand$reply[1183] <- 1
roomdata_rand$reply[1184] <- 1
roomdata_rand$reply[1185] <- 1
roomdata_rand$reply[1187] <- 1
roomdata_rand$reply[1189] <- 1
roomdata_rand$reply[1190] <- 1
roomdata_rand$reply[1196] <- 1
roomdata_rand$reply[1197] <- 1
roomdata_rand$reply[1199] <- 1
roomdata_rand$reply[1200] <- 1
roomdata_rand$reply[1202] <- 1
roomdata_rand$reply[1204] <- 1
roomdata_rand$reply[1205] <- 1
roomdata_rand$reply[1207] <- 1
roomdata_rand$reply[1209] <- 1
roomdata_rand$reply[1210] <- 1
roomdata_rand$reply[1211] <- 1
roomdata_rand$reply[1214] <- 1
roomdata_rand$reply[1215] <- 1
roomdata_rand$reply[1216] <- 1
roomdata_rand$reply[1217] <- 1
roomdata_rand$reply[1218] <- 1
roomdata_rand$reply[1219] <- 1
roomdata_rand$reply[1224] <- 1
roomdata_rand$reply[1225] <- 1
roomdata_rand$reply[1231] <- 1
roomdata_rand$reply[1233] <- 1
roomdata_rand$reply[1235] <- 1
roomdata_rand$reply[1237] <- 1
roomdata_rand$reply[1239] <- 1
roomdata_rand$reply[1241] <- 1
roomdata_rand$reply[1242] <- 1
roomdata_rand$reply[1243] <- 1
roomdata_rand$reply[1245] <- 1
roomdata_rand$reply[1247] <- 1
roomdata_rand$reply[1248] <- 1
roomdata_rand$reply[1249] <- 1
roomdata_rand$reply[1252] <- 1
roomdata_rand$reply[1253] <- 1
roomdata_rand$reply[1255] <- 1
roomdata_rand$reply[1256] <- 1
roomdata_rand$reply[1260] <- 1
roomdata_rand$reply[1261] <- 1
roomdata_rand$reply[1262] <- 1
roomdata_rand$reply[1263] <- 1
roomdata_rand$reply[1264] <- 1
roomdata_rand$reply[1266] <- 1
roomdata_rand$reply[1267] <- 1
roomdata_rand$reply[1268] <- 1
roomdata_rand$reply[1272] <- 1
roomdata_rand$reply[1276] <- 1
roomdata_rand$reply[1277] <- 1
roomdata_rand$reply[1278] <- 1
roomdata_rand$reply[1280] <- 1
roomdata_rand$reply[1281] <- 1
roomdata_rand$reply[1283] <- 1
roomdata_rand$reply[1285] <- 1
roomdata_rand$reply[1287] <- 1
roomdata_rand$reply[1288] <- 1
roomdata_rand$reply[1289] <- 1
roomdata_rand$reply[1293] <- 1
roomdata_rand$reply[1297] <- 1
roomdata_rand$reply[1298] <- 1
roomdata_rand$reply[1299] <- 1
roomdata_rand$reply[1300] <- 1
roomdata_rand$reply[1304] <- 1
roomdata_rand$reply[1306] <- 1
roomdata_rand$reply[1308] <- 1
roomdata_rand$reply[1309] <- 1
roomdata_rand$reply[1310] <- 1
roomdata_rand$reply[1311] <- 1
roomdata_rand$reply[1314] <- 1
roomdata_rand$reply[1315] <- 1
roomdata_rand$reply[1317] <- 1
roomdata_rand$reply[1318] <- 1
roomdata_rand$reply[1320] <- 1
roomdata_rand$reply[1321] <- 1
roomdata_rand$reply[1322] <- 1
roomdata_rand$reply[1324] <- 1
roomdata_rand$reply[1327] <- 1
roomdata_rand$reply[1329] <- 1
roomdata_rand$reply[1330] <- 1
roomdata_rand$reply[1331] <- 1
roomdata_rand$reply[1333] <- 1
roomdata_rand$reply[1335] <- 1
roomdata_rand$reply[1337] <- 1
roomdata_rand$reply[1340] <- 1
roomdata_rand$reply[1341] <- 1
roomdata_rand$reply[1342] <- 1
roomdata_rand$reply[1344] <- NA
roomdata_rand$reply[1345] <- 1
roomdata_rand$reply[1347] <- NA
roomdata_rand$reply[1349] <- NA
roomdata_rand$reply[1350] <- 1
roomdata_rand$reply[1351] <- 1
roomdata_rand$reply[1355] <- 1
roomdata_rand$reply[1357] <- NA
roomdata_rand$reply[1359] <- 1
roomdata_rand$reply[1360] <- 1
roomdata_rand$reply[1362] <- 1
roomdata_rand$reply[1363] <- 1
roomdata_rand$reply[1365] <- 1
roomdata_rand$reply[1367] <- 1
roomdata_rand$reply[1368] <- 1
roomdata_rand$reply[1369] <- 1
roomdata_rand$reply[1371] <- 1
roomdata_rand$reply[1373] <- 1
roomdata_rand$reply[1380] <- 1
roomdata_rand$reply[1381] <- 1
roomdata_rand$reply[1382] <- 1
roomdata_rand$reply[1384] <- 1
roomdata_rand$reply[1386] <- 1
roomdata_rand$reply[1387] <- 1
roomdata_rand$reply[1388] <- 1
roomdata_rand$reply[1389] <- 1
roomdata_rand$reply[1392] <- 1
roomdata_rand$reply[1396] <- 1
roomdata_rand$reply[1397] <- 1
roomdata_rand$reply[1400] <- NA
roomdata_rand$reply[1401] <- NA
roomdata_rand$reply[1403] <- 1
roomdata_rand$reply[1404] <- 1
roomdata_rand$reply[1405] <- 1
roomdata_rand$reply[1407] <- NA
roomdata_rand$reply[1408] <- 1
roomdata_rand$reply[1409] <- 1
roomdata_rand$reply[1410] <- 1
roomdata_rand$reply[1411] <- 1
roomdata_rand$reply[1414] <- 1
roomdata_rand$reply[1415] <- 1
roomdata_rand$reply[1416] <- 1
roomdata_rand$reply[1417] <- 1
roomdata_rand$reply[1418] <- 1
roomdata_rand$reply[1420] <- 1
roomdata_rand$reply[1421] <- NA
roomdata_rand$reply[1422] <- 1
roomdata_rand$reply[1424] <- 1
roomdata_rand$reply[1426] <- 1
roomdata_rand$reply[1429] <- 1
roomdata_rand$reply[1430] <- 1
roomdata_rand$reply[1435] <- 1
roomdata_rand$reply[1436] <- 1
roomdata_rand$reply[1437] <- 1

# Substantive replies
roomdata_rand$substantive <- 0
roomdata_rand$substantive[2] <- 1
roomdata_rand$substantive[9] <- 1
roomdata_rand$substantive[11] <- 1
roomdata_rand$substantive[12] <- 1
roomdata_rand$substantive[14] <- 1
roomdata_rand$substantive[19] <- 1
roomdata_rand$substantive[12] <- 1
roomdata_rand$substantive[24] <- 1
roomdata_rand$substantive[25] <- NA
roomdata_rand$substantive[27] <- 1
roomdata_rand$substantive[28] <- 1
roomdata_rand$substantive[29] <- 1
roomdata_rand$substantive[31] <- 1
roomdata_rand$substantive[33] <- NA
roomdata_rand$substantive[34] <- 1
roomdata_rand$substantive[36] <- NA
roomdata_rand$substantive[38] <- 1
roomdata_rand$substantive[39] <- 1
roomdata_rand$substantive[41] <- 1
roomdata_rand$substantive[47] <- 1
roomdata_rand$substantive[50] <- 1
roomdata_rand$substantive[52] <- 1
roomdata_rand$substantive[59] <- 1
roomdata_rand$substantive[62] <- 1
roomdata_rand$substantive[64] <- 1
roomdata_rand$substantive[65] <- 1
roomdata_rand$substantive[69] <- 1
roomdata_rand$substantive[77] <- 1
roomdata_rand$substantive[79] <- 1
roomdata_rand$substantive[82] <- 1
roomdata_rand$substantive[85] <- 1
roomdata_rand$substantive[87] <- 1
roomdata_rand$substantive[88] <- 1
roomdata_rand$substantive[90] <- NA
roomdata_rand$substantive[92] <- 1
roomdata_rand$substantive[95] <- 1
roomdata_rand$substantive[98] <- 1
roomdata_rand$substantive[99] <- 1
roomdata_rand$substantive[103] <- 1
roomdata_rand$substantive[104] <- 1
roomdata_rand$substantive[105] <- 1
roomdata_rand$substantive[106] <- 1
roomdata_rand$substantive[107] <- 1
roomdata_rand$substantive[110] <- 1
roomdata_rand$substantive[111] <- 1
roomdata_rand$substantive[115] <- 1
roomdata_rand$substantive[117] <- 1
roomdata_rand$substantive[123] <- 1
roomdata_rand$substantive[124] <- 1
roomdata_rand$substantive[125] <- 1
roomdata_rand$substantive[128] <- 1
roomdata_rand$substantive[129] <- 1
roomdata_rand$substantive[131] <- 1
roomdata_rand$substantive[134] <- 1
roomdata_rand$substantive[136] <- 1
roomdata_rand$substantive[137] <- 1
roomdata_rand$substantive[139] <- 1
roomdata_rand$substantive[141] <- NA
roomdata_rand$substantive[143] <- 1
roomdata_rand$substantive[145] <- 1
roomdata_rand$substantive[146] <- 1
roomdata_rand$substantive[148] <- 1
roomdata_rand$substantive[149] <- 1
roomdata_rand$substantive[151] <- 1
roomdata_rand$substantive[153] <- 1
roomdata_rand$substantive[156] <- 1
roomdata_rand$substantive[159] <- 1
roomdata_rand$substantive[160] <- 1
roomdata_rand$substantive[161] <- 1
roomdata_rand$substantive[162] <- 1
roomdata_rand$substantive[164] <- 1
roomdata_rand$substantive[166] <- NA
roomdata_rand$substantive[167] <- 1
roomdata_rand$substantive[168] <- 1
roomdata_rand$substantive[169] <- 1
roomdata_rand$substantive[170] <- 1
roomdata_rand$substantive[174] <- 1
roomdata_rand$substantive[176] <- 1
roomdata_rand$substantive[178] <- 1
roomdata_rand$substantive[181] <- NA
roomdata_rand$substantive[182] <- 1
roomdata_rand$substantive[184] <- 1
roomdata_rand$substantive[185] <- 1
roomdata_rand$substantive[186] <- 1
roomdata_rand$substantive[189] <- 1
roomdata_rand$substantive[190] <- 1
roomdata_rand$substantive[192] <- 1
roomdata_rand$substantive[194] <- 1
roomdata_rand$substantive[197] <- NA
roomdata_rand$substantive[198] <- 1
roomdata_rand$substantive[199] <- 1
roomdata_rand$substantive[200] <- 1
roomdata_rand$substantive[201] <- NA
roomdata_rand$substantive[202] <- 1
roomdata_rand$substantive[206] <- 1
roomdata_rand$substantive[207] <- 1
roomdata_rand$substantive[210] <- 1
roomdata_rand$substantive[211] <- 1
roomdata_rand$substantive[215] <- 1
roomdata_rand$substantive[216] <- 1
roomdata_rand$substantive[217] <- 1
roomdata_rand$substantive[219] <- 1
roomdata_rand$substantive[220] <- 1
roomdata_rand$substantive[221] <- 1
roomdata_rand$substantive[225] <- 1
roomdata_rand$substantive[229] <- NA
roomdata_rand$substantive[230] <- 1
roomdata_rand$substantive[233] <- 1
roomdata_rand$substantive[234] <- 1
roomdata_rand$substantive[235] <- 1
roomdata_rand$substantive[236] <- 1
roomdata_rand$substantive[238] <- 1
roomdata_rand$substantive[239] <- 1
roomdata_rand$substantive[240] <- NA
roomdata_rand$substantive[249] <- 1
roomdata_rand$substantive[255] <- NA
roomdata_rand$substantive[256] <- NA
roomdata_rand$substantive[262] <- NA
roomdata_rand$substantive[263] <- NA
roomdata_rand$substantive[264] <- 1
roomdata_rand$substantive[265] <- 1
roomdata_rand$substantive[266] <- 1
roomdata_rand$substantive[269] <- 1
roomdata_rand$substantive[272] <- 1
roomdata_rand$substantive[274] <- 1
roomdata_rand$substantive[275] <- 1
roomdata_rand$substantive[276] <- 1
roomdata_rand$substantive[278] <- 1
roomdata_rand$substantive[281] <- 1
roomdata_rand$substantive[284] <- 1
roomdata_rand$substantive[285] <- 1
roomdata_rand$substantive[286] <- 1
roomdata_rand$substantive[288] <- 1
roomdata_rand$substantive[289] <- 1
roomdata_rand$substantive[292] <- 1
roomdata_rand$substantive[293] <- 1
roomdata_rand$substantive[294] <- 1
roomdata_rand$substantive[295] <- 1
roomdata_rand$substantive[296] <- 1
roomdata_rand$substantive[297] <- 1
roomdata_rand$substantive[299] <- 1
roomdata_rand$substantive[301] <- 1
roomdata_rand$substantive[303] <- NA
roomdata_rand$substantive[305] <- 1
roomdata_rand$substantive[306] <- 1
roomdata_rand$substantive[307] <- 1
roomdata_rand$substantive[315] <- 1
roomdata_rand$substantive[316] <- NA
roomdata_rand$substantive[322] <- 1
roomdata_rand$substantive[324] <- 1
roomdata_rand$substantive[325] <- 1
roomdata_rand$substantive[329] <- 1
roomdata_rand$substantive[330] <- 1
roomdata_rand$substantive[335] <- 1
roomdata_rand$substantive[336] <- 1
roomdata_rand$substantive[338] <- 1
roomdata_rand$substantive[340] <- 1
roomdata_rand$substantive[341] <- 1
roomdata_rand$substantive[342] <- 1
roomdata_rand$substantive[343] <- 1
roomdata_rand$substantive[347] <- 1
roomdata_rand$substantive[351] <- 1
roomdata_rand$substantive[354] <- 1
roomdata_rand$substantive[356] <- 1
roomdata_rand$substantive[361] <- 1
roomdata_rand$substantive[362] <- 1
roomdata_rand$substantive[363] <- 1
roomdata_rand$substantive[369] <- 1
roomdata_rand$substantive[371] <- 1
roomdata_rand$substantive[372] <- 1
roomdata_rand$substantive[374] <- 1
roomdata_rand$substantive[376] <- NA
roomdata_rand$substantive[379] <- 1
roomdata_rand$substantive[380] <- NA
roomdata_rand$substantive[382] <- 1
roomdata_rand$substantive[383] <- 1
roomdata_rand$substantive[385] <- 1
roomdata_rand$substantive[387] <- 1
roomdata_rand$substantive[392] <- 1
roomdata_rand$substantive[393] <- 1
roomdata_rand$substantive[395] <- 1
roomdata_rand$substantive[396] <- 1
roomdata_rand$substantive[397] <- 1
roomdata_rand$substantive[401] <- 1
roomdata_rand$substantive[404] <- 1
roomdata_rand$substantive[405] <- NA
roomdata_rand$substantive[408] <- NA
roomdata_rand$substantive[411] <- 1
roomdata_rand$substantive[414] <- 1
roomdata_rand$substantive[415] <- 1
roomdata_rand$substantive[416] <- 1
roomdata_rand$substantive[417] <- 1
roomdata_rand$substantive[419] <- 1
roomdata_rand$substantive[420] <- 1
roomdata_rand$substantive[425] <- 1
roomdata_rand$substantive[428] <- 1
roomdata_rand$substantive[430] <- 1
roomdata_rand$substantive[432] <- 1
roomdata_rand$substantive[433] <- 1
roomdata_rand$substantive[436] <- 1
roomdata_rand$substantive[439] <- 1
roomdata_rand$substantive[440] <- NA
roomdata_rand$substantive[441] <- 1
roomdata_rand$substantive[444] <- 1
roomdata_rand$substantive[445] <- 1
roomdata_rand$substantive[447] <- 1
roomdata_rand$substantive[449] <- 1
roomdata_rand$substantive[450] <- 1
roomdata_rand$substantive[452] <- 1
roomdata_rand$substantive[453] <- 1
roomdata_rand$substantive[454] <- 1
roomdata_rand$substantive[457] <- 1
roomdata_rand$substantive[459] <- 1
roomdata_rand$substantive[461] <- 1
roomdata_rand$substantive[464] <- 1
roomdata_rand$substantive[466] <- 1
roomdata_rand$substantive[469] <- NA
roomdata_rand$substantive[470] <- 1
roomdata_rand$substantive[471] <- 1
roomdata_rand$substantive[473] <- 1
roomdata_rand$substantive[474] <- NA
roomdata_rand$substantive[477] <- 1
roomdata_rand$substantive[486] <- 1
roomdata_rand$substantive[489] <- 1
roomdata_rand$substantive[491] <- 1
roomdata_rand$substantive[499] <- 1
roomdata_rand$substantive[501] <- 1
roomdata_rand$substantive[505] <- 1
roomdata_rand$substantive[506] <- 1
roomdata_rand$substantive[507] <- 1
roomdata_rand$substantive[512] <- 1
roomdata_rand$substantive[513] <- 1
roomdata_rand$substantive[518] <- 1
roomdata_rand$substantive[520] <- NA
roomdata_rand$substantive[522] <- 1
roomdata_rand$substantive[523] <- 1
roomdata_rand$substantive[526] <- 1
roomdata_rand$substantive[532] <- NA
roomdata_rand$substantive[533] <- 1
roomdata_rand$substantive[534] <- 1
roomdata_rand$substantive[535] <- 1
roomdata_rand$substantive[536] <- 1
roomdata_rand$substantive[540] <- 1
roomdata_rand$substantive[542] <- 1
roomdata_rand$substantive[543] <- 1
roomdata_rand$substantive[550] <- 1
roomdata_rand$substantive[552] <- 1
roomdata_rand$substantive[554] <- 1
roomdata_rand$substantive[556] <- 1
roomdata_rand$substantive[558] <- NA
roomdata_rand$substantive[560] <- 1
roomdata_rand$substantive[563] <- 1
roomdata_rand$substantive[564] <- NA
roomdata_rand$substantive[568] <- 1
roomdata_rand$substantive[569] <- 1
roomdata_rand$substantive[574] <- 1
roomdata_rand$substantive[575] <- 1
roomdata_rand$substantive[578] <- 1
roomdata_rand$substantive[579] <- 1
roomdata_rand$substantive[580] <- 1
roomdata_rand$substantive[583] <- 1
roomdata_rand$substantive[586] <- 1
roomdata_rand$substantive[587] <- 1
roomdata_rand$substantive[588] <- 1
roomdata_rand$substantive[593] <- 1
roomdata_rand$substantive[596] <- NA
roomdata_rand$substantive[597] <- 1
roomdata_rand$substantive[600] <- 1
roomdata_rand$substantive[604] <- 1
roomdata_rand$substantive[617] <- 1
roomdata_rand$substantive[621] <- NA
roomdata_rand$substantive[627] <- 1
roomdata_rand$substantive[630] <- 1
roomdata_rand$substantive[638] <- 1
roomdata_rand$substantive[644] <- 1
roomdata_rand$substantive[646] <- 1
roomdata_rand$substantive[648] <- 1
roomdata_rand$substantive[653] <- 1
roomdata_rand$substantive[655] <- 1
roomdata_rand$substantive[661] <- 1
roomdata_rand$substantive[664] <- 1
roomdata_rand$substantive[665] <- 1
roomdata_rand$substantive[667] <- 1
roomdata_rand$substantive[669] <- 1
roomdata_rand$substantive[670] <- 1
roomdata_rand$substantive[677] <- 1
roomdata_rand$substantive[680] <- NA
roomdata_rand$substantive[681] <- 1
roomdata_rand$substantive[682] <- 1
roomdata_rand$substantive[684] <- 1
roomdata_rand$substantive[687] <- 1
roomdata_rand$substantive[692] <- 1
roomdata_rand$substantive[693] <- 1
roomdata_rand$substantive[694] <- 1
roomdata_rand$substantive[697] <- NA
roomdata_rand$substantive[698] <- 1
roomdata_rand$substantive[699] <- 1
roomdata_rand$substantive[700] <- 1
roomdata_rand$substantive[703] <- 1
roomdata_rand$substantive[704] <- 1
roomdata_rand$substantive[705] <- 1
roomdata_rand$substantive[709] <- 1
roomdata_rand$substantive[710] <- 1
roomdata_rand$substantive[712] <- NA
roomdata_rand$substantive[713] <- 1
roomdata_rand$substantive[717] <- 1
roomdata_rand$substantive[718] <- 1
roomdata_rand$substantive[720] <- NA
roomdata_rand$substantive[723] <- 1
roomdata_rand$substantive[725] <- 1
roomdata_rand$substantive[731] <- 1
roomdata_rand$substantive[733] <- NA
roomdata_rand$substantive[734] <- 1
roomdata_rand$substantive[735] <- 1
roomdata_rand$substantive[737] <- 1
roomdata_rand$substantive[738] <- NA
roomdata_rand$substantive[742] <- 1
roomdata_rand$substantive[743] <- NA
roomdata_rand$substantive[749] <- NA
roomdata_rand$substantive[750] <- 1
roomdata_rand$substantive[754] <- 1
roomdata_rand$substantive[759] <- NA
roomdata_rand$substantive[761] <- 1
roomdata_rand$substantive[763] <- 1
roomdata_rand$substantive[764] <- 1
roomdata_rand$substantive[765] <- NA
roomdata_rand$substantive[767] <- NA
roomdata_rand$substantive[768] <- 1
roomdata_rand$substantive[772] <- 1
roomdata_rand$substantive[773] <- 1
roomdata_rand$substantive[777] <- 1
roomdata_rand$substantive[782] <- 1
roomdata_rand$substantive[786] <- 1
roomdata_rand$substantive[788] <- 1
roomdata_rand$substantive[789] <- 1
roomdata_rand$substantive[791] <- 1
roomdata_rand$substantive[793] <- 1
roomdata_rand$substantive[794] <- 1
roomdata_rand$substantive[796] <- 1
roomdata_rand$substantive[798] <- 1
roomdata_rand$substantive[799] <- 1
roomdata_rand$substantive[800] <- 1
roomdata_rand$substantive[801] <- NA
roomdata_rand$substantive[804] <- 1
roomdata_rand$substantive[805] <- 1
roomdata_rand$substantive[810] <- 1
roomdata_rand$substantive[815] <- 1
roomdata_rand$substantive[816] <- 1
roomdata_rand$substantive[822] <- 1
roomdata_rand$substantive[823] <- 1
roomdata_rand$substantive[824] <- 1
roomdata_rand$substantive[826] <- NA
roomdata_rand$substantive[830] <- 1
roomdata_rand$substantive[831] <- NA
roomdata_rand$substantive[833] <- 1
roomdata_rand$substantive[841] <- 1
roomdata_rand$substantive[842] <- 1
roomdata_rand$substantive[843] <- NA
roomdata_rand$substantive[847] <- 1
roomdata_rand$substantive[851] <- NA
roomdata_rand$substantive[852] <- NA
roomdata_rand$substantive[853] <- NA
roomdata_rand$substantive[854] <- NA
roomdata_rand$substantive[855] <- NA
roomdata_rand$substantive[856] <- NA
roomdata_rand$substantive[858] <- 1
roomdata_rand$substantive[861] <- 1
roomdata_rand$substantive[863] <- 1
roomdata_rand$substantive[865] <- 1
roomdata_rand$substantive[866] <- NA
roomdata_rand$substantive[867] <- NA
roomdata_rand$substantive[868] <- 1
roomdata_rand$substantive[877] <- 1
roomdata_rand$substantive[878] <- 1
roomdata_rand$substantive[879] <- 1
roomdata_rand$substantive[880] <- 1
roomdata_rand$substantive[887] <- 1
roomdata_rand$substantive[888] <- 1
roomdata_rand$substantive[890] <- 1
roomdata_rand$substantive[891] <- 1
roomdata_rand$substantive[892] <- 1
roomdata_rand$substantive[894] <- 1
roomdata_rand$substantive[895] <- NA
roomdata_rand$substantive[896] <- NA
roomdata_rand$substantive[897] <- NA
roomdata_rand$substantive[900] <- NA
roomdata_rand$substantive[901] <- NA
roomdata_rand$substantive[902] <- 1
roomdata_rand$substantive[905] <- 1
roomdata_rand$substantive[906] <- 1
roomdata_rand$substantive[909] <- 1
roomdata_rand$substantive[912] <- 1
roomdata_rand$substantive[913] <- 1
roomdata_rand$substantive[915] <- NA
roomdata_rand$substantive[916] <- 1
roomdata_rand$substantive[917] <- 1
roomdata_rand$substantive[925] <- 1
roomdata_rand$substantive[928] <- 1
roomdata_rand$substantive[929] <- 1
roomdata_rand$substantive[931] <- NA
roomdata_rand$substantive[932] <- 1
roomdata_rand$substantive[935] <- 1
roomdata_rand$substantive[936] <- 1
roomdata_rand$substantive[937] <- 1
roomdata_rand$substantive[940] <- 1
roomdata_rand$substantive[941] <- 1
roomdata_rand$substantive[950] <- 1
roomdata_rand$substantive[952] <- NA
roomdata_rand$substantive[955] <- 1
roomdata_rand$substantive[957] <- 1
roomdata_rand$substantive[958] <- 1
roomdata_rand$substantive[959] <- 1
roomdata_rand$substantive[964] <- 1
roomdata_rand$substantive[966] <- 1
roomdata_rand$substantive[969] <- 1
roomdata_rand$substantive[970] <- 1
roomdata_rand$substantive[971] <- 1
roomdata_rand$substantive[972] <- 1
roomdata_rand$substantive[974] <- NA
roomdata_rand$substantive[976] <- 1
roomdata_rand$substantive[979] <- 1
roomdata_rand$substantive[980] <- 1
roomdata_rand$substantive[982] <- 1
roomdata_rand$substantive[986] <- 1
roomdata_rand$substantive[988] <- NA
roomdata_rand$substantive[997] <- NA
roomdata_rand$substantive[1001] <- 1
roomdata_rand$substantive[1002] <- 1
roomdata_rand$substantive[1006] <- 1
roomdata_rand$substantive[1008] <- 1
roomdata_rand$substantive[1011] <- 1
roomdata_rand$substantive[1013] <- 1
roomdata_rand$substantive[1014] <- 1
roomdata_rand$substantive[1015] <- 1
roomdata_rand$substantive[1017] <- 1
roomdata_rand$substantive[1021] <- 1
roomdata_rand$substantive[1023] <- 1
roomdata_rand$substantive[1025] <- 1
roomdata_rand$substantive[1026] <- NA
roomdata_rand$substantive[1027] <- NA
roomdata_rand$substantive[1036] <- 1
roomdata_rand$substantive[1037] <- 1
roomdata_rand$substantive[1038] <- 1
roomdata_rand$substantive[1039] <- 1
roomdata_rand$substantive[1040] <- 1
roomdata_rand$substantive[1042] <- 1
roomdata_rand$substantive[1044] <- 1
roomdata_rand$substantive[1045] <- 1
roomdata_rand$substantive[1048] <- NA
roomdata_rand$substantive[1049] <- 1
roomdata_rand$substantive[1050] <- 1
roomdata_rand$substantive[1051] <- 1
roomdata_rand$substantive[1052] <- 1
roomdata_rand$substantive[1064] <- 1
roomdata_rand$substantive[1066] <- NA
roomdata_rand$substantive[1067] <- 1
roomdata_rand$substantive[1068] <- 1
roomdata_rand$substantive[1071] <- NA
roomdata_rand$substantive[1074] <- 1
roomdata_rand$substantive[1075] <- 1
roomdata_rand$substantive[1076] <- 1
roomdata_rand$substantive[1080] <- 1
roomdata_rand$substantive[1083] <- 1
roomdata_rand$substantive[1085] <- 1
roomdata_rand$substantive[1090] <- 1
roomdata_rand$substantive[1091] <- 1
roomdata_rand$substantive[1092] <- 1
roomdata_rand$substantive[1094] <- 1
roomdata_rand$substantive[1096] <- 1
roomdata_rand$substantive[1098] <- 1
roomdata_rand$substantive[1100] <- 1
roomdata_rand$substantive[1101] <- 1
roomdata_rand$substantive[1102] <- 1
roomdata_rand$substantive[1103] <- 1
roomdata_rand$substantive[1104] <- 1
roomdata_rand$substantive[1108] <- 1
roomdata_rand$substantive[1109] <- 1
roomdata_rand$substantive[1110] <- 1
roomdata_rand$substantive[1111] <- 1
roomdata_rand$substantive[1114] <- NA
roomdata_rand$substantive[1117] <- 1
roomdata_rand$substantive[1118] <- 1
roomdata_rand$substantive[1119] <- 1
roomdata_rand$substantive[1121] <- NA
roomdata_rand$substantive[1125] <- NA
roomdata_rand$substantive[1131] <- 1
roomdata_rand$substantive[1132] <- 1
roomdata_rand$substantive[1134] <- 1
roomdata_rand$substantive[1135] <- 1
roomdata_rand$substantive[1136] <- 1
roomdata_rand$substantive[1137] <- 1
roomdata_rand$substantive[1140] <- 1
roomdata_rand$substantive[1141] <- 1
roomdata_rand$substantive[1144] <- 1
roomdata_rand$substantive[1147] <- 1
roomdata_rand$substantive[1150] <- 1
roomdata_rand$substantive[1153] <- 1
roomdata_rand$substantive[1155] <- 1
roomdata_rand$substantive[1160] <- 1
roomdata_rand$substantive[1161] <- 1
roomdata_rand$substantive[1163] <- 1
roomdata_rand$substantive[1164] <- 1
roomdata_rand$substantive[1165] <- 1
roomdata_rand$substantive[1166] <- 1
roomdata_rand$substantive[1167] <- 1
roomdata_rand$substantive[1173] <- 1
roomdata_rand$substantive[1174] <- 1
roomdata_rand$substantive[1178] <- 1
roomdata_rand$substantive[1183] <- 1
roomdata_rand$substantive[1185] <- 1
roomdata_rand$substantive[1187] <- 1
roomdata_rand$substantive[1189] <- 1
roomdata_rand$substantive[1190] <- 1
roomdata_rand$substantive[1196] <- 1
roomdata_rand$substantive[1197] <- 1
roomdata_rand$substantive[1202] <- 1
roomdata_rand$substantive[1205] <- 1
roomdata_rand$substantive[1207] <- 1
roomdata_rand$substantive[1209] <- 1
roomdata_rand$substantive[1210] <- 1
roomdata_rand$substantive[1214] <- 1
roomdata_rand$substantive[1215] <- 1
roomdata_rand$substantive[1216] <- 1
roomdata_rand$substantive[1217] <- 1
roomdata_rand$substantive[1218] <- 1
roomdata_rand$substantive[1219] <- 1
roomdata_rand$substantive[1224] <- 1
roomdata_rand$substantive[1225] <- 1
roomdata_rand$substantive[1231] <- 1
roomdata_rand$substantive[1233] <- 1
roomdata_rand$substantive[1235] <- 1
roomdata_rand$substantive[1237] <- 1
roomdata_rand$substantive[1242] <- 1
roomdata_rand$substantive[1251] <- NA
roomdata_rand$substantive[1252] <- 1
roomdata_rand$substantive[1253] <- 1
roomdata_rand$substantive[1254] <- 1
roomdata_rand$substantive[1256] <- 1
roomdata_rand$substantive[1260] <- 1
roomdata_rand$substantive[1261] <- 1
roomdata_rand$substantive[1262] <- 1
roomdata_rand$substantive[1263] <- 1
roomdata_rand$substantive[1264] <- 1
roomdata_rand$substantive[1266] <- 1
roomdata_rand$substantive[1267] <- 1
roomdata_rand$substantive[1268] <- 1
roomdata_rand$substantive[1272] <- 1
roomdata_rand$substantive[1276] <- 1
roomdata_rand$substantive[1277] <- 1
roomdata_rand$substantive[1278] <- 1
roomdata_rand$substantive[1280] <- 1
roomdata_rand$substantive[1281] <- 1
roomdata_rand$substantive[1282] <- NA
roomdata_rand$substantive[1283] <- 1
roomdata_rand$substantive[1287] <- 1
roomdata_rand$substantive[1289] <- 1
roomdata_rand$substantive[1293] <- 1
roomdata_rand$substantive[1298] <- 1
roomdata_rand$substantive[1299] <- 1
roomdata_rand$substantive[1304] <- 1
roomdata_rand$substantive[1306] <- 1
roomdata_rand$substantive[1310] <- 1
roomdata_rand$substantive[1311] <- 1
roomdata_rand$substantive[1317] <- 1
roomdata_rand$substantive[1318] <- 1
roomdata_rand$substantive[1320] <- 1
roomdata_rand$substantive[1321] <- 1
roomdata_rand$substantive[1322] <- 1
roomdata_rand$substantive[1324] <- 1
roomdata_rand$substantive[1327] <- 1
roomdata_rand$substantive[1329] <- 1
roomdata_rand$substantive[1330] <- 1
roomdata_rand$substantive[1332] <- NA
roomdata_rand$substantive[1334] <- NA
roomdata_rand$substantive[1337] <- 1
roomdata_rand$substantive[1338] <- NA
roomdata_rand$substantive[1340] <- 1
roomdata_rand$substantive[1341] <- 1
roomdata_rand$substantive[1342] <- 1
roomdata_rand$substantive[1344] <- NA
roomdata_rand$substantive[1345] <- 1
roomdata_rand$substantive[1347] <- NA
roomdata_rand$substantive[1349] <- NA
roomdata_rand$substantive[1350] <- 1
roomdata_rand$substantive[1351] <- 1
roomdata_rand$substantive[1357] <- NA
roomdata_rand$substantive[1360] <- 1
roomdata_rand$substantive[1362] <- 1
roomdata_rand$substantive[1363] <- 1
roomdata_rand$substantive[1367] <- 1
roomdata_rand$substantive[1369] <- 1
roomdata_rand$substantive[1371] <- 1
roomdata_rand$substantive[1380] <- 1
roomdata_rand$substantive[1381] <- 1
roomdata_rand$substantive[1382] <- 1
roomdata_rand$substantive[1384] <- 1
roomdata_rand$substantive[1386] <- 1
roomdata_rand$substantive[1387] <- 1
roomdata_rand$substantive[1389] <- 1
roomdata_rand$substantive[1392] <- 1
roomdata_rand$substantive[1393] <- 1
roomdata_rand$substantive[1394] <- 1
roomdata_rand$substantive[1396] <- 1
roomdata_rand$substantive[1397] <- 1
roomdata_rand$substantive[1400] <- NA
roomdata_rand$substantive[1401] <- NA
roomdata_rand$substantive[1407] <- NA
roomdata_rand$substantive[1408] <- 1
roomdata_rand$substantive[1409] <- 1
roomdata_rand$substantive[1410] <- 1
roomdata_rand$substantive[1411] <- 1
roomdata_rand$substantive[1414] <- 1
roomdata_rand$substantive[1415] <- 1
roomdata_rand$substantive[1417] <- 1
roomdata_rand$substantive[1418] <- 1
roomdata_rand$substantive[1421] <- NA
roomdata_rand$substantive[1422] <- 1
roomdata_rand$substantive[1424] <- 1
roomdata_rand$substantive[1426] <- 1
roomdata_rand$substantive[1429] <- 1
roomdata_rand$substantive[1436] <- 1
roomdata_rand$substantive[1437] <- 1

# days to reply
roomdata_rand$days <- 31
roomdata_rand$days[2] <- 1
roomdata_rand$days[3] <- 1
roomdata_rand$days[9] <- 7
roomdata_rand$days[11] <- 1
roomdata_rand$days[12] <- 1
roomdata_rand$days[14] <- 1
roomdata_rand$days[15] <- 1
roomdata_rand$days[16] <- 8
roomdata_rand$days[19] <- 1
roomdata_rand$days[20] <- 1
roomdata_rand$days[21] <- 1
roomdata_rand$days[22] <- 1
roomdata_rand$days[24] <- 0
roomdata_rand$days[25] <- NA
roomdata_rand$days[27] <- 0
roomdata_rand$days[28] <- 5
roomdata_rand$days[29] <- 1
roomdata_rand$days[31] <- 1
roomdata_rand$days[33] <- NA
roomdata_rand$days[34] <- 1
roomdata_rand$days[32] <- 2
roomdata_rand$days[36] <- NA
roomdata_rand$days[38] <- 0
roomdata_rand$days[39] <- 26
roomdata_rand$days[41] <- 2
roomdata_rand$days[45] <- 1
roomdata_rand$days[47] <- 1
roomdata_rand$days[49] <- 0
roomdata_rand$days[50] <- 1
roomdata_rand$days[52] <- 1
roomdata_rand$days[53] <- 1
roomdata_rand$days[56] <- 1
roomdata_rand$days[59] <- 0
roomdata_rand$days[62] <- 1
roomdata_rand$days[64] <- 1
roomdata_rand$days[65] <- 0
roomdata_rand$days[69] <- 1
roomdata_rand$days[70] <- 1
roomdata_rand$days[71] <- 1
roomdata_rand$days[73] <- 0
roomdata_rand$days[74] <- 0
roomdata_rand$days[77] <- 1
roomdata_rand$days[79] <- 1
roomdata_rand$days[82] <- 0
roomdata_rand$days[83] <- 1
roomdata_rand$days[84] <- 5
roomdata_rand$days[85] <- 1
roomdata_rand$days[87] <- 1
roomdata_rand$days[88] <- 1
roomdata_rand$days[89] <- 1
roomdata_rand$days[90] <- NA
roomdata_rand$days[92] <- 1
roomdata_rand$days[95] <- 0
roomdata_rand$days[97] <- 1
roomdata_rand$days[98] <- 1
roomdata_rand$days[99] <- 7
roomdata_rand$days[102] <- 7
roomdata_rand$days[103] <- 1
roomdata_rand$days[104] <- 1
roomdata_rand$days[105] <- 1
roomdata_rand$days[106] <- 1
roomdata_rand$days[107] <- 0
roomdata_rand$days[110] <- 1
roomdata_rand$days[111] <- 1
roomdata_rand$days[112] <- 5
roomdata_rand$days[113] <- 2
roomdata_rand$days[115] <- 1
roomdata_rand$days[117] <- 1
roomdata_rand$days[120] <- 0
roomdata_rand$days[122] <- 1
roomdata_rand$days[123] <- 1
roomdata_rand$days[124] <- 8
roomdata_rand$days[125] <- 1
roomdata_rand$days[127] <- 1
roomdata_rand$days[128] <- 1
roomdata_rand$days[129] <- 1
roomdata_rand$days[131] <- 2
roomdata_rand$days[134] <- 9
roomdata_rand$days[136] <- 1
roomdata_rand$days[137] <- 1
roomdata_rand$days[139] <- 1
roomdata_rand$days[141] <- NA
roomdata_rand$days[143] <- 0
roomdata_rand$days[145] <- 1
roomdata_rand$days[146] <- 2
roomdata_rand$days[148] <- 1
roomdata_rand$days[149] <- 2
roomdata_rand$days[150] <- 1
roomdata_rand$days[151] <- 1
roomdata_rand$days[152] <- 2
roomdata_rand$days[153] <- 1
roomdata_rand$days[154] <- 1
roomdata_rand$days[156] <- 0
roomdata_rand$days[159] <- 1
roomdata_rand$days[160] <- 1
roomdata_rand$days[161] <- 1
roomdata_rand$days[162] <- 2
roomdata_rand$days[164] <- 1
roomdata_rand$days[166] <- NA
roomdata_rand$days[167] <- 20
roomdata_rand$days[168] <- 5
roomdata_rand$days[169] <- 2
roomdata_rand$days[170] <- 1
roomdata_rand$days[172] <- 1
roomdata_rand$days[174] <- 1
roomdata_rand$days[176] <- 1
roomdata_rand$days[178] <- 0
roomdata_rand$days[181] <- NA
roomdata_rand$days[182] <- 1
roomdata_rand$days[184] <- 1
roomdata_rand$days[185] <- 1
roomdata_rand$days[186] <- 1
roomdata_rand$days[188] <- 1
roomdata_rand$days[189] <- 1
roomdata_rand$days[190] <- 1
roomdata_rand$days[192] <- 7
roomdata_rand$days[193] <- 1
roomdata_rand$days[194] <- 1
roomdata_rand$days[197] <- NA
roomdata_rand$days[198] <- 1
roomdata_rand$days[199] <- 1
roomdata_rand$days[200] <- 1
roomdata_rand$days[201] <- NA
roomdata_rand$days[202] <- 1
roomdata_rand$days[204] <- 1
roomdata_rand$days[205] <- 1
roomdata_rand$days[206] <- 1
roomdata_rand$days[207] <- 1
roomdata_rand$days[208] <- 1
roomdata_rand$days[210] <- 2
roomdata_rand$days[211] <- 1
roomdata_rand$days[213] <- 1
roomdata_rand$days[215] <- 1
roomdata_rand$days[216] <- 1
roomdata_rand$days[217] <- 1
roomdata_rand$days[219] <- 1
roomdata_rand$days[220] <- 1
roomdata_rand$days[221] <- 1
roomdata_rand$days[225] <- 0
roomdata_rand$days[227] <- 1
roomdata_rand$days[228] <- 1
roomdata_rand$days[229] <- NA
roomdata_rand$days[230] <- 1
roomdata_rand$days[233] <- 1
roomdata_rand$days[234] <- 5
roomdata_rand$days[235] <- 1
roomdata_rand$days[236] <- 1
roomdata_rand$days[237] <- 2
roomdata_rand$days[238] <- 1
roomdata_rand$days[239] <- 5
roomdata_rand$days[240] <- NA
roomdata_rand$days[244] <- 1
roomdata_rand$days[249] <- 1
roomdata_rand$days[255] <- NA
roomdata_rand$days[256] <- NA
roomdata_rand$days[262] <- NA
roomdata_rand$days[263] <- NA
roomdata_rand$days[264] <- 1
roomdata_rand$days[265] <- 2
roomdata_rand$days[266] <- 1
roomdata_rand$days[268] <- 1
roomdata_rand$days[269] <- 1
roomdata_rand$days[272] <- 1
roomdata_rand$days[274] <- 1
roomdata_rand$days[275] <- 1
roomdata_rand$days[276] <- 1
roomdata_rand$days[278] <- 1
roomdata_rand$days[279] <- 1
roomdata_rand$days[280] <- 1
roomdata_rand$days[281] <- 1
roomdata_rand$days[282] <- 1
roomdata_rand$days[283] <- 1
roomdata_rand$days[284] <- 1
roomdata_rand$days[285] <- 1
roomdata_rand$days[286] <- 1
roomdata_rand$days[288] <- 1
roomdata_rand$days[289] <- 1
roomdata_rand$days[292] <- 1
roomdata_rand$days[293] <- 2
roomdata_rand$days[294] <- 1
roomdata_rand$days[295] <- 1
roomdata_rand$days[296] <- 1
roomdata_rand$days[297] <- 1
roomdata_rand$days[299] <- 1
roomdata_rand$days[301] <- 1
roomdata_rand$days[303] <- NA
roomdata_rand$days[305] <- 1
roomdata_rand$days[306] <- 1
roomdata_rand$days[307] <- 1
roomdata_rand$days[308] <- 1
roomdata_rand$days[310] <- 2
roomdata_rand$days[311] <- 1
roomdata_rand$days[315] <- 1
roomdata_rand$days[316] <- NA
roomdata_rand$days[317] <- 1
roomdata_rand$days[322] <- 1
roomdata_rand$days[323] <- 1
roomdata_rand$days[324] <- 0
roomdata_rand$days[325] <- 1
roomdata_rand$days[329] <- 1
roomdata_rand$days[330] <- 1
roomdata_rand$days[334] <- 1
roomdata_rand$days[335] <- 2
roomdata_rand$days[336] <- 1
roomdata_rand$days[338] <- 5
roomdata_rand$days[340] <- 1
roomdata_rand$days[341] <- 1
roomdata_rand$days[342] <- 1
roomdata_rand$days[343] <- 1
roomdata_rand$days[344] <- 1
roomdata_rand$days[347] <- 1
roomdata_rand$days[349] <- 1
roomdata_rand$days[350] <- 2
roomdata_rand$days[351] <- 1
roomdata_rand$days[354] <- 1
roomdata_rand$days[355] <- 1
roomdata_rand$days[356] <- 1
roomdata_rand$days[357] <- 1
roomdata_rand$days[361] <- 1
roomdata_rand$days[362] <- 1
roomdata_rand$days[363] <- 1
roomdata_rand$days[367] <- 1
roomdata_rand$days[368] <- 0
roomdata_rand$days[369] <- 0
roomdata_rand$days[370] <- 1
roomdata_rand$days[371] <- 1
roomdata_rand$days[372] <- 1
roomdata_rand$days[373] <- 1
roomdata_rand$days[374] <- 1
roomdata_rand$days[376] <- NA
roomdata_rand$days[379] <- 1
roomdata_rand$days[380] <- NA
roomdata_rand$days[382] <- 1
roomdata_rand$days[383] <- 1
roomdata_rand$days[385] <- 1
roomdata_rand$days[387] <- 1
roomdata_rand$days[390] <- 1
roomdata_rand$days[391] <- 1
roomdata_rand$days[392] <- 1
roomdata_rand$days[393] <- 5
roomdata_rand$days[394] <- 1
roomdata_rand$days[395] <- 1
roomdata_rand$days[396] <- 1
roomdata_rand$days[397] <- 2
roomdata_rand$days[401] <- 1
roomdata_rand$days[404] <- 1
roomdata_rand$days[405] <- NA
roomdata_rand$days[408] <- NA
roomdata_rand$days[411] <- 1
roomdata_rand$days[414] <- 1
roomdata_rand$days[415] <- 1
roomdata_rand$days[416] <- 1
roomdata_rand$days[417] <- 1
roomdata_rand$days[419] <- 1
roomdata_rand$days[420] <- 1
roomdata_rand$days[425] <- 1
roomdata_rand$days[426] <- 1
roomdata_rand$days[428] <- 1
roomdata_rand$days[430] <- 5
roomdata_rand$days[431] <- 5
roomdata_rand$days[432] <- 1
roomdata_rand$days[433] <- 1
roomdata_rand$days[436] <- 1
roomdata_rand$days[439] <- 1
roomdata_rand$days[440] <- NA
roomdata_rand$days[441] <- 1
roomdata_rand$days[444] <- 1
roomdata_rand$days[445] <- 1
roomdata_rand$days[446] <- 1
roomdata_rand$days[447] <- 1
roomdata_rand$days[449] <- 1
roomdata_rand$days[450] <- 1
roomdata_rand$days[452] <- 1
roomdata_rand$days[453] <- 1
roomdata_rand$days[454] <- 1
roomdata_rand$days[457] <- 1
roomdata_rand$days[459] <- 1
roomdata_rand$days[461] <- 1
roomdata_rand$days[464] <- 1
roomdata_rand$days[466] <- 1
roomdata_rand$days[469] <- NA
roomdata_rand$days[470] <- 1
roomdata_rand$days[471] <- 1
roomdata_rand$days[473] <- 4
roomdata_rand$days[474] <- NA
roomdata_rand$days[477] <- 2
roomdata_rand$days[479] <- 1
roomdata_rand$days[482] <- 1
roomdata_rand$days[483] <- 1
roomdata_rand$days[486] <- 0
roomdata_rand$days[489] <- 4
roomdata_rand$days[490] <- 1
roomdata_rand$days[491] <- 0
roomdata_rand$days[494] <- 4
roomdata_rand$days[499] <- 1
roomdata_rand$days[501] <- 1
roomdata_rand$days[503] <- 1
roomdata_rand$days[505] <- 0
roomdata_rand$days[506] <- 1
roomdata_rand$days[507] <- 1
roomdata_rand$days[509] <- 1
roomdata_rand$days[512] <- 1
roomdata_rand$days[513] <- 1
roomdata_rand$days[518] <- 1
roomdata_rand$days[519] <- 1
roomdata_rand$days[520] <- NA
roomdata_rand$days[522] <- 1
roomdata_rand$days[523] <- 1
roomdata_rand$days[525] <- 19
roomdata_rand$days[526] <- 4
roomdata_rand$days[532] <- NA
roomdata_rand$days[533] <- 1
roomdata_rand$days[534] <- 1
roomdata_rand$days[535] <- 0
roomdata_rand$days[536] <- 1
roomdata_rand$days[537] <- 1
roomdata_rand$days[538] <- 1
roomdata_rand$days[540] <- 1
roomdata_rand$days[541] <- 1
roomdata_rand$days[542] <- 1
roomdata_rand$days[543] <- 1
roomdata_rand$days[545] <- 1
roomdata_rand$days[546] <- 1
roomdata_rand$days[550] <- 7
roomdata_rand$days[551] <- 5
roomdata_rand$days[552] <- 1
roomdata_rand$days[554] <- 4
roomdata_rand$days[555] <- 1
roomdata_rand$days[556] <- 0
roomdata_rand$days[558] <- NA
roomdata_rand$days[560] <- 7
roomdata_rand$days[563] <- 1
roomdata_rand$days[564] <- NA
roomdata_rand$days[565] <- 5
roomdata_rand$days[568] <- 5
roomdata_rand$days[569] <- 1
roomdata_rand$days[570] <- 4
roomdata_rand$days[571] <- 0
roomdata_rand$days[574] <- 1
roomdata_rand$days[575] <- 1
roomdata_rand$days[578] <- 1
roomdata_rand$days[579] <- 1
roomdata_rand$days[580] <- 6
roomdata_rand$days[582] <- 4
roomdata_rand$days[583] <- 1
roomdata_rand$days[586] <- 1
roomdata_rand$days[587] <- 1
roomdata_rand$days[588] <- 1
roomdata_rand$days[593] <- 1
roomdata_rand$days[596] <- NA
roomdata_rand$days[597] <- 1
roomdata_rand$days[600] <- 1
roomdata_rand$days[604] <- 1
roomdata_rand$days[610] <- 0
roomdata_rand$days[611] <- 0
roomdata_rand$days[617] <- 1
roomdata_rand$days[620] <- 1
roomdata_rand$days[621] <- NA
roomdata_rand$days[627] <- 1
roomdata_rand$days[628] <- 1
roomdata_rand$days[629] <- 1
roomdata_rand$days[630] <- 1
roomdata_rand$days[631] <- 1
roomdata_rand$days[632] <- 1
roomdata_rand$days[638] <- 1
roomdata_rand$days[639] <- 1
roomdata_rand$days[640] <- 1
roomdata_rand$days[641] <- 1
roomdata_rand$days[642] <- 1
roomdata_rand$days[644] <- 0
roomdata_rand$days[645] <- 0
roomdata_rand$days[646] <- 1
roomdata_rand$days[648] <- 1
roomdata_rand$days[649] <- 4
roomdata_rand$days[650] <- 1
roomdata_rand$days[653] <- 1
roomdata_rand$days[655] <- 1
roomdata_rand$days[656] <- 1
roomdata_rand$days[661] <- 1
roomdata_rand$days[663] <- 1
roomdata_rand$days[664] <- 1
roomdata_rand$days[665] <- 1
roomdata_rand$days[667] <- 5
roomdata_rand$days[668] <- 1
roomdata_rand$days[669] <- 1
roomdata_rand$days[670] <- 1
roomdata_rand$days[672] <- 0
roomdata_rand$days[673] <- 1
roomdata_rand$days[677] <- 1
roomdata_rand$days[680] <- NA
roomdata_rand$days[681] <- 1
roomdata_rand$days[682] <- 1
roomdata_rand$days[684] <- 1
roomdata_rand$days[687] <- 1
roomdata_rand$days[688] <- 1
roomdata_rand$days[689] <- 0
roomdata_rand$days[692] <- 1
roomdata_rand$days[693] <- 1
roomdata_rand$days[694] <- 1
roomdata_rand$days[697] <- NA
roomdata_rand$days[698] <- 1
roomdata_rand$days[699] <- 1
roomdata_rand$days[700] <- 1
roomdata_rand$days[703] <- 1
roomdata_rand$days[704] <- 1
roomdata_rand$days[705] <- 1
roomdata_rand$days[709] <- 4
roomdata_rand$days[710] <- 1
roomdata_rand$days[711] <- 1
roomdata_rand$days[712] <- NA
roomdata_rand$days[713] <- 1
roomdata_rand$days[716] <- 1
roomdata_rand$days[717] <- 1
roomdata_rand$days[718] <- 1
roomdata_rand$days[720] <- NA
roomdata_rand$days[721] <- 4
roomdata_rand$days[723] <- 1
roomdata_rand$days[725] <- 1
roomdata_rand$days[727] <- 1
roomdata_rand$days[730] <- 1
roomdata_rand$days[731] <- 1
roomdata_rand$days[733] <- NA
roomdata_rand$days[734] <- 1
roomdata_rand$days[735] <- 1
roomdata_rand$days[736] <- 1
roomdata_rand$days[737] <- 1
roomdata_rand$days[738] <- NA
roomdata_rand$days[740] <- 5
roomdata_rand$days[742] <- 1
roomdata_rand$days[743] <- NA
roomdata_rand$days[749] <- NA
roomdata_rand$days[750] <- 1
roomdata_rand$days[751] <- 1
roomdata_rand$days[754] <- 1
roomdata_rand$days[759] <- NA
roomdata_rand$days[760] <- 1
roomdata_rand$days[761] <- 1
roomdata_rand$days[763] <- 1
roomdata_rand$days[764] <- 1
roomdata_rand$days[765] <- NA
roomdata_rand$days[767] <- NA
roomdata_rand$days[768] <- 1
roomdata_rand$days[769] <- 1
roomdata_rand$days[772] <- 1
roomdata_rand$days[773] <- 4
roomdata_rand$days[774] <- 1
roomdata_rand$days[776] <- 1
roomdata_rand$days[777] <- 1
roomdata_rand$days[778] <- 1
roomdata_rand$days[779] <- 1
roomdata_rand$days[782] <- 1
roomdata_rand$days[786] <- 1
roomdata_rand$days[788] <- 1
roomdata_rand$days[789] <- 1
roomdata_rand$days[790] <- 1
roomdata_rand$days[791] <- 4
roomdata_rand$days[792] <- 1
roomdata_rand$days[793] <- 5
roomdata_rand$days[794] <- 4
roomdata_rand$days[795] <- 1
roomdata_rand$days[796] <- 1
roomdata_rand$days[797] <- 1
roomdata_rand$days[798] <- 1
roomdata_rand$days[799] <- 1
roomdata_rand$days[800] <- 1
roomdata_rand$days[801] <- NA
roomdata_rand$days[802] <- 6
roomdata_rand$days[803] <- 4
roomdata_rand$days[804] <- 1
roomdata_rand$days[805] <- 1
roomdata_rand$days[808] <- 4
roomdata_rand$days[810] <- 1
roomdata_rand$days[813] <- 1
roomdata_rand$days[814] <- 1
roomdata_rand$days[815] <- 1
roomdata_rand$days[816] <- 1
roomdata_rand$days[819] <- 1
roomdata_rand$days[820] <- 1
roomdata_rand$days[821] <- 1
roomdata_rand$days[822] <- 4
roomdata_rand$days[823] <- 1
roomdata_rand$days[824] <- 1
roomdata_rand$days[826] <- NA
roomdata_rand$days[827] <- 1
roomdata_rand$days[828] <- 1
roomdata_rand$days[830] <- 1
roomdata_rand$days[831] <- NA
roomdata_rand$days[833] <- 1
roomdata_rand$days[837] <- 1
roomdata_rand$days[841] <- 1
roomdata_rand$days[842] <- 1
roomdata_rand$days[843] <- NA
roomdata_rand$days[845] <- 1
roomdata_rand$days[846] <- 7
roomdata_rand$days[847] <- 5
roomdata_rand$days[848] <- 0
roomdata_rand$days[849] <- 1
roomdata_rand$days[851] <- NA
roomdata_rand$days[852] <- NA
roomdata_rand$days[853] <- NA
roomdata_rand$days[854] <- NA
roomdata_rand$days[855] <- NA
roomdata_rand$days[856] <- NA
roomdata_rand$days[858] <- 4
roomdata_rand$days[861] <- 1
roomdata_rand$days[863] <- 1
roomdata_rand$days[865] <- 1
roomdata_rand$days[866] <- NA
roomdata_rand$days[867] <- NA
roomdata_rand$days[868] <- 2
roomdata_rand$days[873] <- 2
roomdata_rand$days[874] <- 2
roomdata_rand$days[875] <- 2
roomdata_rand$days[877] <- 2
roomdata_rand$days[878] <- 2
roomdata_rand$days[879] <- 17
roomdata_rand$days[880] <- 2
roomdata_rand$days[881] <- 2
roomdata_rand$days[887] <- 4
roomdata_rand$days[888] <- 2
roomdata_rand$days[889] <- 2
roomdata_rand$days[890] <- 2
roomdata_rand$days[891] <- 2
roomdata_rand$days[892] <- 2
roomdata_rand$days[894] <- 1
roomdata_rand$days[895] <- NA
roomdata_rand$days[896] <- NA
roomdata_rand$days[897] <- NA
roomdata_rand$days[900] <- NA
roomdata_rand$days[901] <- NA
roomdata_rand$days[902] <- 2
roomdata_rand$days[904] <- 16
roomdata_rand$days[905] <- 1
roomdata_rand$days[906] <- 1
roomdata_rand$days[908] <- 1
roomdata_rand$days[909] <- 1
roomdata_rand$days[912] <- 1
roomdata_rand$days[913] <- 1
roomdata_rand$days[915] <- NA
roomdata_rand$days[916] <- 1
roomdata_rand$days[917] <- 1
roomdata_rand$days[920] <- 1
roomdata_rand$days[925] <- 1
roomdata_rand$days[926] <- 1
roomdata_rand$days[928] <- 0
roomdata_rand$days[929] <- 0
roomdata_rand$days[931] <- NA
roomdata_rand$days[932] <- 1
roomdata_rand$days[935] <- 5
roomdata_rand$days[936] <- 1
roomdata_rand$days[937] <- 1
roomdata_rand$days[938] <- 0
roomdata_rand$days[939] <- 1
roomdata_rand$days[940] <- 1
roomdata_rand$days[941] <- 1
roomdata_rand$days[949] <- 1
roomdata_rand$days[950] <- 1
roomdata_rand$days[952] <- NA
roomdata_rand$days[955] <- 1
roomdata_rand$days[957] <- 0
roomdata_rand$days[958] <- 0
roomdata_rand$days[959] <- 0
roomdata_rand$days[964] <- 1
roomdata_rand$days[965] <- 1
roomdata_rand$days[966] <- 1
roomdata_rand$days[969] <- 0
roomdata_rand$days[970] <- 2
roomdata_rand$days[971] <- 1
roomdata_rand$days[972] <- 1
roomdata_rand$days[973] <- 1
roomdata_rand$days[974] <- NA
roomdata_rand$days[976] <- 1
roomdata_rand$days[979] <- 1
roomdata_rand$days[980] <- 1
roomdata_rand$days[982] <- 1
roomdata_rand$days[986] <- 1
roomdata_rand$days[988] <- NA
roomdata_rand$days[997] <- NA
roomdata_rand$days[1000] <- 1
roomdata_rand$days[1001] <- 1
roomdata_rand$days[1002] <- 1
roomdata_rand$days[1004] <- 1
roomdata_rand$days[1005] <- 1
roomdata_rand$days[1006] <- 2
roomdata_rand$days[1008] <- 1
roomdata_rand$days[1010] <- 3
roomdata_rand$days[1011] <- 2
roomdata_rand$days[1013] <- 0
roomdata_rand$days[1014] <- 1
roomdata_rand$days[1015] <- 1
roomdata_rand$days[1017] <- 1
roomdata_rand$days[1020] <- 1
roomdata_rand$days[1021] <- 1
roomdata_rand$days[1023] <- 1
roomdata_rand$days[1025] <- 1
roomdata_rand$days[1026] <- NA
roomdata_rand$days[1027] <- NA
roomdata_rand$days[1030] <- 1
roomdata_rand$days[1031] <- 1
roomdata_rand$days[1032] <- 1
roomdata_rand$days[1033] <- 2
roomdata_rand$days[1036] <- 1
roomdata_rand$days[1037] <- 2
roomdata_rand$days[1038] <- 2
roomdata_rand$days[1039] <- 1
roomdata_rand$days[1040] <- 1
roomdata_rand$days[1042] <- 1
roomdata_rand$days[1044] <- 1
roomdata_rand$days[1045] <- 1
roomdata_rand$days[1046] <- 1
roomdata_rand$days[1048] <- NA
roomdata_rand$days[1049] <- 1
roomdata_rand$days[1050] <- 2
roomdata_rand$days[1051] <- 1
roomdata_rand$days[1052] <- 0
roomdata_rand$days[1055] <- 1
roomdata_rand$days[1059] <- 0
roomdata_rand$days[1061] <- 1
roomdata_rand$days[1063] <- 1
roomdata_rand$days[1064] <- 0
roomdata_rand$days[1065] <- 1
roomdata_rand$days[1066] <- NA
roomdata_rand$days[1067] <- 3
roomdata_rand$days[1068] <- 0
roomdata_rand$days[1071] <- NA
roomdata_rand$days[1074] <- 1
roomdata_rand$days[1075] <- 1
roomdata_rand$days[1076] <- 2
roomdata_rand$days[1079] <- 1
roomdata_rand$days[1080] <- 0
roomdata_rand$days[1083] <- 1
roomdata_rand$days[1085] <- 1
roomdata_rand$days[1089] <- 2
roomdata_rand$days[1090] <- 1
roomdata_rand$days[1091] <- 0
roomdata_rand$days[1092] <- 0
roomdata_rand$days[1094] <- 0
roomdata_rand$days[1096] <- 2
roomdata_rand$days[1098] <- 1
roomdata_rand$days[1100] <- 1
roomdata_rand$days[1101] <- 2
roomdata_rand$days[1102] <- 7
roomdata_rand$days[1103] <- 0
roomdata_rand$days[1104] <- 2
roomdata_rand$days[1105] <- 1
roomdata_rand$days[1108] <- 1
roomdata_rand$days[1109] <- 3
roomdata_rand$days[1110] <- 1
roomdata_rand$days[1111] <- 1
roomdata_rand$days[1114] <- NA
roomdata_rand$days[1117] <- 1
roomdata_rand$days[1118] <- 1
roomdata_rand$days[1119] <- 1
roomdata_rand$days[1121] <- NA
roomdata_rand$days[1122] <- 1
roomdata_rand$days[1124] <- 1
roomdata_rand$days[1125] <- NA
roomdata_rand$days[1126] <- 1
roomdata_rand$days[1127] <- 7
roomdata_rand$days[1130] <- 1
roomdata_rand$days[1131] <- 3
roomdata_rand$days[1132] <- 2
roomdata_rand$days[1134] <- 1
roomdata_rand$days[1135] <- 1
roomdata_rand$days[1136] <- 1
roomdata_rand$days[1137] <- 1
roomdata_rand$days[1140] <- 1
roomdata_rand$days[1141] <- 1
roomdata_rand$days[1144] <- 1
roomdata_rand$days[1145] <- 0
roomdata_rand$days[1147] <- 3
roomdata_rand$days[1148] <- 0
roomdata_rand$days[1149] <- 1
roomdata_rand$days[1150] <- 1
roomdata_rand$days[1151] <- 1
roomdata_rand$days[1152] <- 1
roomdata_rand$days[1153] <- 0
roomdata_rand$days[1155] <- 1
roomdata_rand$days[1160] <- 1
roomdata_rand$days[1161] <- 1
roomdata_rand$days[1163] <- 1
roomdata_rand$days[1164] <- 1
roomdata_rand$days[1165] <- 1
roomdata_rand$days[1166] <- 1
roomdata_rand$days[1167] <- 2
roomdata_rand$days[1168] <- 0
roomdata_rand$days[1170] <- 0
roomdata_rand$days[1171] <- 2
roomdata_rand$days[1173] <- 1
roomdata_rand$days[1174] <- 2
roomdata_rand$days[1178] <- 1
roomdata_rand$days[1180] <- 1
roomdata_rand$days[1183] <- 1
roomdata_rand$days[1184] <- 1
roomdata_rand$days[1185] <- 1
roomdata_rand$days[1187] <- 1
roomdata_rand$days[1189] <- 1
roomdata_rand$days[1190] <- 2
roomdata_rand$days[1196] <- 1
roomdata_rand$days[1197] <- 0
roomdata_rand$days[1199] <- 1
roomdata_rand$days[1200] <- 1
roomdata_rand$days[1202] <- 1
roomdata_rand$days[1204] <- 1
roomdata_rand$days[1205] <- 1
roomdata_rand$days[1207] <- 1
roomdata_rand$days[1209] <- 1
roomdata_rand$days[1210] <- 1
roomdata_rand$days[1211] <- 1
roomdata_rand$days[1214] <- 0
roomdata_rand$days[1215] <- 1
roomdata_rand$days[1216] <- 1
roomdata_rand$days[1217] <- 4
roomdata_rand$days[1218] <- 0
roomdata_rand$days[1219] <- 0
roomdata_rand$days[1224] <- 1
roomdata_rand$days[1225] <- 1
roomdata_rand$days[1231] <- 1
roomdata_rand$days[1233] <- 1
roomdata_rand$days[1235] <- 0
roomdata_rand$days[1237] <- 2
roomdata_rand$days[1239] <- 0
roomdata_rand$days[1241] <- 2
roomdata_rand$days[1242] <- 0
roomdata_rand$days[1243] <- 2
roomdata_rand$days[1245] <- 1
roomdata_rand$days[1247] <- 1
roomdata_rand$days[1248] <- 1
roomdata_rand$days[1249] <- 1
roomdata_rand$days[1251] <- NA
roomdata_rand$days[1252] <- 1
roomdata_rand$days[1253] <- 1
roomdata_rand$days[1254] <- 0
roomdata_rand$days[1255] <- 2
roomdata_rand$days[1256] <- 1
roomdata_rand$days[1260] <- 1
roomdata_rand$days[1261] <- 1
roomdata_rand$days[1262] <- 3
roomdata_rand$days[1263] <- 1
roomdata_rand$days[1264] <- 1
roomdata_rand$days[1266] <- 0
roomdata_rand$days[1267] <- 7
roomdata_rand$days[1268] <- 1
roomdata_rand$days[1272] <- 1
roomdata_rand$days[1276] <- 1
roomdata_rand$days[1277] <- 2
roomdata_rand$days[1278] <- 1
roomdata_rand$days[1280] <- 1
roomdata_rand$days[1281] <- 1
roomdata_rand$days[1282] <- NA
roomdata_rand$days[1283] <- 1
roomdata_rand$days[1285] <- 1
roomdata_rand$days[1287] <- 1
roomdata_rand$days[1288] <- 2
roomdata_rand$days[1289] <- 1
roomdata_rand$days[1293] <- 1
roomdata_rand$days[1297] <- 1
roomdata_rand$days[1298] <- 1
roomdata_rand$days[1299] <- 1
roomdata_rand$days[1300] <- 1
roomdata_rand$days[1304] <- 2
roomdata_rand$days[1306] <- 1
roomdata_rand$days[1308] <- 1
roomdata_rand$days[1309] <- 2
roomdata_rand$days[1310] <- 1
roomdata_rand$days[1311] <- 0
roomdata_rand$days[1314] <- 1
roomdata_rand$days[1315] <- 1
roomdata_rand$days[1317] <- 2
roomdata_rand$days[1318] <- 1
roomdata_rand$days[1320] <- 3
roomdata_rand$days[1321] <- 1
roomdata_rand$days[1322] <- 1
roomdata_rand$days[1324] <- 1
roomdata_rand$days[1327] <- 1
roomdata_rand$days[1329] <- 1
roomdata_rand$days[1330] <- 1
roomdata_rand$days[1331] <- 3
roomdata_rand$days[1332] <- NA
roomdata_rand$days[1333] <- 1
roomdata_rand$days[1334] <- NA
roomdata_rand$days[1335] <- 1
roomdata_rand$days[1337] <- 1
roomdata_rand$days[1338] <- NA
roomdata_rand$days[1340] <- 3
roomdata_rand$days[1341] <- 2
roomdata_rand$days[1342] <- 1
roomdata_rand$days[1344] <- NA
roomdata_rand$days[1345] <- 1
roomdata_rand$days[1347] <- NA
roomdata_rand$days[1349] <- NA
roomdata_rand$days[1350] <- 1
roomdata_rand$days[1351] <- 1
roomdata_rand$days[1355] <- 1
roomdata_rand$days[1357] <- NA
roomdata_rand$days[1359] <- 1
roomdata_rand$days[1360] <- 1
roomdata_rand$days[1362] <- 1
roomdata_rand$days[1363] <- 1
roomdata_rand$days[1365] <- 1
roomdata_rand$days[1367] <- 1
roomdata_rand$days[1368] <- 1
roomdata_rand$days[1369] <- 1
roomdata_rand$days[1371] <- 2
roomdata_rand$days[1373] <- 1
roomdata_rand$days[1380] <- 1
roomdata_rand$days[1381] <- 1
roomdata_rand$days[1382] <- 1
roomdata_rand$days[1384] <- 1
roomdata_rand$days[1386] <- 1
roomdata_rand$days[1387] <- 1
roomdata_rand$days[1388] <- 1
roomdata_rand$days[1389] <- 1
roomdata_rand$days[1392] <- 1
roomdata_rand$days[1393] <- 1
roomdata_rand$days[1394] <- 1
roomdata_rand$days[1396] <- 1
roomdata_rand$days[1397] <- 1
roomdata_rand$days[1400] <- NA
roomdata_rand$days[1401] <- NA
roomdata_rand$days[1403] <- 1
roomdata_rand$days[1404] <- 1
roomdata_rand$days[1405] <- 1
roomdata_rand$days[1407] <- NA
roomdata_rand$days[1408] <- 1
roomdata_rand$days[1409] <- 1
roomdata_rand$days[1410] <- 1
roomdata_rand$days[1411] <- 1
roomdata_rand$days[1414] <- 1
roomdata_rand$days[1415] <- 12
roomdata_rand$days[1416] <- 1
roomdata_rand$days[1417] <- 2
roomdata_rand$days[1418] <- 1
roomdata_rand$days[1420] <- 1
roomdata_rand$days[1421] <- NA
roomdata_rand$days[1422] <- 1
roomdata_rand$days[1424] <- 8
roomdata_rand$days[1426] <- 1
roomdata_rand$days[1429] <- 1
roomdata_rand$days[1430] <- 1
roomdata_rand$days[1435] <- 1
roomdata_rand$days[1436] <- 3
roomdata_rand$days[1437] <- 3

# Ensuring Emails that Received No Reply at all Are Coded as 31 days and Not Substantive
roomdata_rand[, 21][roomdata_rand[, 19] == 0] <- 31
roomdata_rand[, 20][roomdata_rand[, 19] == 0] <- 0

# Creating a variable for case identifier
roomdata_rand$case <- 1:nrow(roomdata_rand)

# Creating county and county-level trump vote variables
roomdata_rand$county <-NA
roomdata_rand$trumpvote <- NA

# County and Trump Vote Data Collection
roomdata_rand$county[1] <- "Lancaster_NE"
roomdata_rand$trumpvote[1] <- 46.6
roomdata_rand$county[2] <- "Philadelphia_PA"
roomdata_rand$trumpvote[2] <- 15.5
  roomdata_rand$county[3] <- "Huntingdon_PA"
  roomdata_rand$trumpvote[3] <- 73.7
  roomdata_rand$county[4] <- "Albany_NY"
  roomdata_rand$trumpvote[4] <- 35.2
  roomdata_rand$county[5] <- "Frederick_MD"
  roomdata_rand$trumpvote[5] <- 49.1
  roomdata_rand$county[6] <- "Lake_FL"
  roomdata_rand$trumpvote[6] <- 60
  roomdata_rand$county[7] <- "Marion_OR"
  roomdata_rand$trumpvote[7] <- 49
  roomdata_rand$county[8] <- "Westchester_NY"
  roomdata_rand$trumpvote[8] <- 32.1
  roomdata_rand$county[9] <- "Lehigh_PA"
  roomdata_rand$trumpvote[9] <- 35.9
  roomdata_rand$county[10] <- "Worcester_MA"
  roomdata_rand$trumpvote[10] <- 41.2
  roomdata_rand$county[11] <- "Elko_NV"
  roomdata_rand$trumpvote[11] <- 73
  roomdata_rand$county[12] <-"Lane_OR" 
  roomdata_rand$trumpvote[12] <- 36.6
  roomdata_rand$county[13] <- "Bowie_TX"
  roomdata_rand$trumpvote[13] <- 72.3
  roomdata_rand$county[14] <- "Wayne_MI"
  roomdata_rand$trumpvote[14] <- 29.5
  roomdata_rand$county[15] <- "Los Angeles_CA"
  roomdata_rand$trumpvote[15] <- 23.4
  roomdata_rand$county[16] <- "Dallas_TX"
  roomdata_rand$trumpvote[16] <- 34.9
  roomdata_rand$county[17] <- "Mahoning_OH"
  roomdata_rand$trumpvote[17] <- 46.8
  roomdata_rand$county[18] <- "Hampshire_MA"
  roomdata_rand$trumpvote[18] <- 26.8
  roomdata_rand$county[19] <- "Tom Green_TX"
  roomdata_rand$trumpvote[19] <- 71.8
  roomdata_rand$county[20] <- "Cook_IL"
  roomdata_rand$trumpvote[20] <- 21.4
  roomdata_rand$county[21] <- "New Haven_CT"
  roomdata_rand$trumpvote[21] <- 42.1
  roomdata_rand$county[22] <- "Knox_OH"
  roomdata_rand$trumpvote[22] <- 66.9
  roomdata_rand$county[23] <- "Defiance_OH"
  roomdata_rand$trumpvote[23] <- 64.5
  roomdata_rand$county[24] <- "Stanislaus_CA"
  roomdata_rand$trumpvote[24] <- 46.7
  roomdata_rand$county[25] <- "Baltimore_MD"
  roomdata_rand$trumpvote[25] <- 39.1
  roomdata_rand$county[26] <- "Lucas_OH"
  roomdata_rand$trumpvote[26] <- 38.7
  roomdata_rand$county[27] <- "Honolulu_HI"
  roomdata_rand$trumpvote[27] <- 31.7
  roomdata_rand$county[28] <- "Harris_TX"
  roomdata_rand$trumpvote[28] <- 41.8
  roomdata_rand$county[29] <- "Pickens_SC"
  roomdata_rand$trumpvote[29] <- 73.9
  roomdata_rand$county[30] <- "Ellis_TX"
  roomdata_rand$trumpvote[30] <- 71.1
  roomdata_rand$county[31] <- "Multnomah_OR"
  roomdata_rand$trumpvote[31] <- 17.6
  roomdata_rand$county[32] <- "Minnehaha_SD"
  roomdata_rand$trumpvote[32] <- 53.7
  roomdata_rand$county[33] <- "Cumberland_ME"
  roomdata_rand$trumpvote[33] <- 33.7
  roomdata_rand$county[34] <- "Upshur_WV"
  roomdata_rand$trumpvote[34] <- 75.9
  roomdata_rand$county[35] <- "Larimer_CO"
  roomdata_rand$trumpvote[35] <- 42.8
  roomdata_rand$county[36] <- "Washtenaw_MI"
  roomdata_rand$trumpvote[36] <- 26.9
  roomdata_rand$county[37] <- "Nassau_NY"
  roomdata_rand$trumpvote[37] <- 45.9
  roomdata_rand$county[38] <- "Polk_FL"
  roomdata_rand$trumpvote[38] <- 55.4
  roomdata_rand$county[39] <- "Habersham_GA"
  roomdata_rand$trumpvote[39] <- 81.7
  roomdata_rand$county[40] <- "Richland_SC"
  roomdata_rand$trumpvote[40] <- 31.1
  roomdata_rand$county[41] <- "Broward_FL"
  roomdata_rand$trumpvote[41] <- 31.4
  roomdata_rand$county[42] <- "Ramsey_MN"
  roomdata_rand$trumpvote[42] <- 26.3
  roomdata_rand$county[43] <- "Jefferson_WI"
  roomdata_rand$trumpvote[43] <- 55.3
  roomdata_rand$county[44] <- "Wyandotte_KS"
  roomdata_rand$trumpvote[44] <- 32.7
  roomdata_rand$county[45] <- "Oklahoma_OK"
  roomdata_rand$trumpvote[45] <- 51.7
  roomdata_rand$county[46] <- "Ramsey_MN"
  roomdata_rand$trumpvote[46] <- 26.3
  roomdata_rand$county[47] <- "Brown_WI"
  roomdata_rand$trumpvote[47] <- 52.7
  roomdata_rand$county[48] <- "Tuscaloosa_AL"
  roomdata_rand$trumpvote[48] <- 58.4
  roomdata_rand$county[49] <- "Essex_MA"
  roomdata_rand$trumpvote[49] <- 36
  roomdata_rand$county[50] <- "Monroe_NY"
  roomdata_rand$trumpvote[50] <- 40.3
  roomdata_rand$county[51] <- "Wood_TX"
  roomdata_rand$trumpvote[51] <- 84.1
  roomdata_rand$county[52] <- "Madison_NY"
  roomdata_rand$trumpvote[52] <- 54.4
  roomdata_rand$county[53] <- "Hillsborough_NH"
  roomdata_rand$trumpvote[53] <- 47.5
  roomdata_rand$county[54] <- "Westchester_NY"
  roomdata_rand$trumpvote[54] <- 32.1
  roomdata_rand$county[55] <- "Jefferson_OH"
  roomdata_rand$trumpvote[55] <- 65.9
  roomdata_rand$county[56] <- "Cambria_OH"
  roomdata_rand$trumpvote[56] <- 67.3
  roomdata_rand$county[57] <- "Watauga_NC"
  roomdata_rand$trumpvote[57] <- 47
  roomdata_rand$county[58] <- "Fairfield_CT"
  roomdata_rand$trumpvote[58] <- 37.9
  roomdata_rand$county[59] <- "Albany_WY"
  roomdata_rand$trumpvote[59] <- 46.3
  roomdata_rand$county[60] <- "Tippecanoe_IN"
  roomdata_rand$trumpvote[60] <- 49.6
  roomdata_rand$county[61] <- "Queens_NY"
  roomdata_rand$trumpvote[61] <- 22.1
  roomdata_rand$county[62] <- "Fulton_GA"
  roomdata_rand$trumpvote[62] <- 27.1
  roomdata_rand$county[63] <- "Mecklenburg_NC"
  roomdata_rand$trumpvote[63] <- 33.4
  roomdata_rand$county[64] <- "Spokane_WA"
  roomdata_rand$trumpvote[64] <- 49.9
  roomdata_rand$county[65] <- "Oklahoma County_OK"
  roomdata_rand$trumpvote[65] <- 51.7
  roomdata_rand$county[66] <- "Fairfield_CT"
  roomdata_rand$trumpvote[66] <- 37.9
  roomdata_rand$county[67] <- "York_NE"
  roomdata_rand$trumpvote[67] <- 74.9
  roomdata_rand$county[68] <- "Mecklenburg_NC"
  roomdata_rand$trumpvote[68] <- 33.4
  roomdata_rand$county[69] <- "Stark_OH"
  roomdata_rand$trumpvote[69] <- 56.4
  roomdata_rand$county[70] <- "Tarrant_TX"
  roomdata_rand$trumpvote[70] <- 52.2
  roomdata_rand$county[71] <- "Franklin_OH"
  roomdata_rand$trumpvote[71] <- 34.7
  roomdata_rand$county[72] <- "Northampton_OH"
  roomdata_rand$trumpvote[72] <- 50
  roomdata_rand$county[73] <- "Los Angeles_CA"
  roomdata_rand$trumpvote[73] <- 23.4
  roomdata_rand$county[74] <- "Fresno_CA"
  roomdata_rand$trumpvote[74] <- 45.5
  roomdata_rand$county[75] <- "Dauphin_PA"
  roomdata_rand$trumpvote[75] <- 46.6
  roomdata_rand$county[76] <- "Clinton_PA"
  roomdata_rand$trumpvote[76] <- 65.4
  roomdata_rand$county[77] <- "Harris_TX"
  roomdata_rand$trumpvote[77] <- 41.8
  roomdata_rand$county[78] <- "Mecosta_MI"
  roomdata_rand$trumpvote[78] <- 60.1
  roomdata_rand$county[79] <- "Rowan_KY"
  roomdata_rand$trumpvote[79] <- 58.5
  roomdata_rand$county[80] <- "Wood_WV"
  roomdata_rand$trumpvote[80] <- 71.4
  roomdata_rand$county[81] <- "Lehigh_PA"
  roomdata_rand$trumpvote[81] <- 45.9
  roomdata_rand$county[82] <- "Alameda_CA"
  roomdata_rand$trumpvote[82] <- 14.9
  roomdata_rand$county[83] <- "Riley_KS"
  roomdata_rand$trumpvote[83] <- 47.9
  roomdata_rand$county[84] <- "Suffolk_MA"
  roomdata_rand$trumpvote[84] <- 16.5
  roomdata_rand$county[85] <- "PhiladelphiaCounty_PA" 
  roomdata_rand$trumpvote[85] <- 15.5
  roomdata_rand$county[86] <- "Guilford_NC"
  roomdata_rand$trumpvote[86] <- 38.7
  roomdata_rand$county[87] <- "Oakland_MI"
  roomdata_rand$trumpvote[87] <- 43.6
  roomdata_rand$county[88] <- "Orange_CA"
  roomdata_rand$trumpvote[88] <- 44.8
  roomdata_rand$county[89] <- "Franklin_PA"
  roomdata_rand$trumpvote[89] <- 71.5
  roomdata_rand$county[90] <- "Des Moines_IA"
  roomdata_rand$trumpvote[90] <- 50.7
  roomdata_rand$county[91] <- "Story_IA"
  roomdata_rand$trumpvote[91] <- 39.1
  roomdata_rand$county[92] <- "Madison_IL"
  roomdata_rand$trumpvote[92] <- 55
  roomdata_rand$county[93] <- "Cook_IL"
  roomdata_rand$trumpvote[93] <- 21.4
  roomdata_rand$county[94] <- "Transylvania_NC"
  roomdata_rand$trumpvote[94] <- 59.9
  roomdata_rand$county[95] <- "Greene_OH"
  roomdata_rand$trumpvote[95] <- 59.7
  roomdata_rand$county[96] <- "Butler_PA"
  roomdata_rand$trumpvote[96] <- 66.7
  roomdata_rand$county[97] <- "Cook_IL"
  roomdata_rand$trumpvote[97] <- 21.4
  roomdata_rand$county[98] <- "Orange_FL"
  roomdata_rand$trumpvote[98] <- 35.7
  roomdata_rand$county[99] <- "Ulster_NY"
  roomdata_rand$trumpvote[99] <- 51.9
  roomdata_rand$county[100] <- "Hartford_CT"
  roomdata_rand$trumpvote[100] <- 37.1
  roomdata_rand$county[101] <- "Norfolk_MA"
  roomdata_rand$trumpvote[101] <- 33.3
  roomdata_rand$county[102] <- "Cook_IL"
  roomdata_rand$trumpvote[102] <- 21.4
  roomdata_rand$county[103] <- "Otsego_NY"
  roomdata_rand$trumpvote[103] <- 53.4
  roomdata_rand$county[104] <- "Warren_KY"
  roomdata_rand$trumpvote[104] <- 59.2
  roomdata_rand$county[105] <- "Forrest_MS"
  roomdata_rand$trumpvote[105] <- 55.5
  roomdata_rand$county[106] <- "Jefferson_KY"
  roomdata_rand$trumpvote[106] <- 41.7
  roomdata_rand$county[107] <- "Cherokee_GA"
  roomdata_rand$trumpvote[107] <- 72.7
  roomdata_rand$county[108] <- "Montgomery_AL"
  roomdata_rand$trumpvote[108] <- 35.9
  roomdata_rand$county[109] <- "Philadelphia_PA"
  roomdata_rand$trumpvote[109] <- 15.5
  roomdata_rand$county[110] <- "Floyd_GA"
  roomdata_rand$trumpvote[110] <- 70.2
  roomdata_rand$county[111] <- "East Baton Rouge_LA"
  roomdata_rand$trumpvote[111] <- 43.1
  roomdata_rand$county[112] <- "Addison_VT"
  roomdata_rand$trumpvote[112] <- 30.1
  roomdata_rand$county[113] <- "Escambia_FL"
  roomdata_rand$trumpvote[113] <- 58.3
  roomdata_rand$county[114] <- "Hampton_VA"
  roomdata_rand$trumpvote[114] <- 29
  roomdata_rand$county[115] <- "New York_NY"
  roomdata_rand$trumpvote[115] <- 10
  roomdata_rand$county[116] <- "San_Francisco_CA"
  roomdata_rand$trumpvote[116] <- 9.4
  roomdata_rand$county[117] <- "St_Louis_MO" 
  roomdata_rand$trumpvote[117] <- 39.5
  roomdata_rand$county[118] <- "St. Charles_MO"
  roomdata_rand$trumpvote[118] <- 60.6
  roomdata_rand$county[119] <- "Westchester_NY"
  roomdata_rand$trumpvote[119] <- 32.1
  roomdata_rand$county[120] <- "Monroe_NY"
  roomdata_rand$trumpvote[120] <- 40.3
  roomdata_rand$county[121] <- "St_Louis_MO" 
  roomdata_rand$trumpvote[121] <- 39.5
  roomdata_rand$county[122] <- "Prince Edward_VA"
  roomdata_rand$trumpvote[122] <- 45
  roomdata_rand$county[123] <- "King_WA"
  roomdata_rand$trumpvote[123] <- 21.7
  roomdata_rand$county[124] <- "HampdenCounty_MA"
  roomdata_rand$trumpvote[124] <- 39
  roomdata_rand$county[125] <- "Hancock_ME"
  roomdata_rand$trumpvote[125] <- 42.8
  roomdata_rand$county[126] <- "Smith_TX"
  roomdata_rand$trumpvote[126] <- 70.5
  roomdata_rand$county[127] <- "Scott_KY"
  roomdata_rand$trumpvote[127] <- 62.3
  roomdata_rand$county[128] <- "Monroe_NY"
  roomdata_rand$trumpvote[128] <- 40.3
  roomdata_rand$county[129] <- "Marion_IN"
  roomdata_rand$trumpvote[129] <- 36.1
  roomdata_rand$county[130] <- "Washington_DC"
  roomdata_rand$trumpvote[130] <- 4.1
  roomdata_rand$county[131] <- "Indiana_PA"
  roomdata_rand$trumpvote[131] <- 66.1
  roomdata_rand$county[132] <- "Dutchess_NY"
  roomdata_rand$trumpvote[132] <- 48.4
  roomdata_rand$county[133] <- "Winona_MN"
  roomdata_rand$trumpvote[133] <- 46.9
  roomdata_rand$county[134] <- "DeKalb_GA"
  roomdata_rand$trumpvote[134] <- 16.1
  roomdata_rand$county[135] <- "Chester_PA"
  roomdata_rand$trumpvote[135] <- 43.3
  roomdata_rand$county[136] <- "Richland_SC"
  roomdata_rand$trumpvote[136] <- 31.1
  roomdata_rand$county[137] <- "Bannock_ID"
  roomdata_rand$trumpvote[137] <- 51.4
  roomdata_rand$county[138] <- "Chittenden_VT"
  roomdata_rand$trumpvote[138] <- 23.7
  roomdata_rand$county[139] <- "BexarCounty_TX"
  roomdata_rand$trumpvote[139] <- 41
  roomdata_rand$county[140] <- "Westchester_NY"
  roomdata_rand$trumpvote[140] <- 32.1
  roomdata_rand$county[141] <- "RapidesParish_LA"
  roomdata_rand$trumpvote[141] <- 64.8
  roomdata_rand$county[142] <- "Oneida_NY"
  roomdata_rand$trumpvote[142] <- 57.8
  roomdata_rand$county[143] <- "Los Angeles_CA"
  roomdata_rand$trumpvote[143] <- 23.4
  roomdata_rand$county[144] <- "Frederick_MD"
  roomdata_rand$trumpvote[144] <- 49.1
  roomdata_rand$county[145] <- "Sumter_GA"
  roomdata_rand$trumpvote[145] <- 48.1
  roomdata_rand$county[146] <- "Los Angeles_CA"
  roomdata_rand$trumpvote[146] <- 23.4
  roomdata_rand$county[147] <- "Hinds_MS"
  roomdata_rand$trumpvote[147] <- 27.2
  roomdata_rand$county[148] <- "Houghton_MI"
  roomdata_rand$trumpvote[148] <- 54.2
  roomdata_rand$county[149] <- "Erath_TX"
  roomdata_rand$trumpvote[149] <- 81.1
  roomdata_rand$county[150] <- "Wake_NC"
  roomdata_rand$trumpvote[150] <- 37.9
  roomdata_rand$county[151] <- "Stearns_MN"
  roomdata_rand$trumpvote[151] <- 60.3
  roomdata_rand$county[152] <- "Jefferson_TX"
  roomdata_rand$trumpvote[152] <- 49
  roomdata_rand$county[153] <- "New York_NY"
  roomdata_rand$trumpvote[153] <- 10
  roomdata_rand$county[154] <- "Spartanburg_SC"
  roomdata_rand$trumpvote[154] <- 63
  roomdata_rand$county[155] <- "Queens_NY"
  roomdata_rand$trumpvote[155] <- 22.1
  roomdata_rand$county[156] <- "Mobile_AL"
  roomdata_rand$trumpvote[156] <- 55.7
  roomdata_rand$county[157] <- "St. Joseph_IN"
  roomdata_rand$trumpvote[157] <- 47.5
  roomdata_rand$county[158] <- "Bamberg_SC"
  roomdata_rand$trumpvote[158] <- 35.5
  roomdata_rand$county[159] <- "Cook_IL"
  roomdata_rand$trumpvote[159] <- 21.4
  roomdata_rand$county[160] <- "Thurston_WA"
  roomdata_rand$trumpvote[160] <- 38
  roomdata_rand$county[161] <- "Pike_KY"
  roomdata_rand$trumpvote[161] <- 80.1
  roomdata_rand$county[162] <- "Washington_DC"
  roomdata_rand$trumpvote[162] <- 4.1
  roomdata_rand$county[163] <- "Vanderburgh_IN"
  roomdata_rand$trumpvote[163] <- 56.2
  roomdata_rand$county[164] <- "Nassau_NY"
  roomdata_rand$trumpvote[164] <- 45.9
  roomdata_rand$county[165] <- "Burleigh_ND"
  roomdata_rand$trumpvote[165] <- 69.3
  roomdata_rand$county[166] <- "Tulsa_OK"
  roomdata_rand$trumpvote[166] <- 58.4
  roomdata_rand$county[167] <- "Gilmer_WV"
  roomdata_rand$trumpvote[167] <- 74.7
  roomdata_rand$county[168] <- "Hancock_OH"
  roomdata_rand$trumpvote[168] <- 67.5
  roomdata_rand$county[169] <- "Palm Beach_FL"
  roomdata_rand$trumpvote[169] <- 41.2
  roomdata_rand$county[170] <- "DeKalb_GA"
  roomdata_rand$trumpvote[170] <- 16.1
  roomdata_rand$county[171] <- "Sullivan_TN"
  roomdata_rand$trumpvote[171] <- 76.1
  roomdata_rand$county[172] <- "Richland_SC"
  roomdata_rand$trumpvote[172] <- 31.1
  roomdata_rand$county[173] <- "Suffolk_MA"
  roomdata_rand$trumpvote[173] <- 16.5
  roomdata_rand$county[174] <- "El Paso_CO"
  roomdata_rand$trumpvote[174] <- 56.3
  roomdata_rand$county[175] <- "Bristol_MA"
  roomdata_rand$trumpvote[175] <- 42.6
  roomdata_rand$county[176] <- "Walworth_WI" 
  roomdata_rand$trumpvote[176] <- 57
  roomdata_rand$county[177] <- "Knox_KY"
  roomdata_rand$trumpvote[177] <- 82.3
  roomdata_rand$county[178] <- "Radford_VA"
  roomdata_rand$trumpvote[178] <- 43.7
  roomdata_rand$county[179] <- "Oswego_NY"
  roomdata_rand$trumpvote[179] <- 58.6
  roomdata_rand$county[180] <- "Adair_KY"
  roomdata_rand$trumpvote[180] <- 80.6
  roomdata_rand$county[181] <- "Greene_OH"
  roomdata_rand$trumpvote[181] <- 59.7
  roomdata_rand$county[182] <- "Winona_MN"
  roomdata_rand$trumpvote[182] <- 46.9
  roomdata_rand$county[183] <- "Cherokee_OK"
  roomdata_rand$trumpvote[183] <- 60.6
  roomdata_rand$county[184] <- "DeKalb_IL"
  roomdata_rand$trumpvote[184] <- 44.7
  roomdata_rand$county[185] <- "Alameda_CA"
  roomdata_rand$trumpvote[185] <- 14.9
  roomdata_rand$county[186] <- "Hays_TX"
  roomdata_rand$trumpvote[186] <- 47.2
  roomdata_rand$county[187] <- "New York_NY"
  roomdata_rand$trumpvote[187] <- 10
  roomdata_rand$county[188] <- "Oklahoma_OK"
  roomdata_rand$trumpvote[188] <- 51.7
  roomdata_rand$county[189] <- "Denver_CO" 
  roomdata_rand$trumpvote[189] <- 18.8
  roomdata_rand$county[190] <- "Douglas_NE"
  roomdata_rand$trumpvote[190] <- 46.5
  roomdata_rand$county[191] <- "Nassau_NY"
  roomdata_rand$trumpvote[191] <- 45.9
  roomdata_rand$county[192] <- "Wayne_NE"
  roomdata_rand$trumpvote[192] <- 71.5
  roomdata_rand$county[193] <-"HowardCounty_IN" 
  roomdata_rand$trumpvote[193] <- 64.4
  roomdata_rand$county[194] <- "Adams_IL"
  roomdata_rand$trumpvote[194] <- 71.6
  roomdata_rand$county[195] <- "CuyahogaCounty_OH" 
  roomdata_rand$trumpvote[195] <- 30.8
  roomdata_rand$county[196] <- "Ohio_WV"
  roomdata_rand$trumpvote[196] <- 62.2
  roomdata_rand$county[197] <- "Montgomery_PA"
  roomdata_rand$trumpvote[197] <- 37.6
  roomdata_rand$county[198] <- "Lyon_MN"
  roomdata_rand$trumpvote[198] <- 59.8
  roomdata_rand$county[199] <- "Lynchburg_VA"
  roomdata_rand$trumpvote[199] <- 50.9
  roomdata_rand$county[200] <- "WashoeCounty_NV"
  roomdata_rand$trumpvote[200] <- 45
  roomdata_rand$county[201] <- "Kerr_TX"
  roomdata_rand$trumpvote[201] <- 76.5
  roomdata_rand$county[202] <- "Denver_CO"
  roomdata_rand$trumpvote[202] <- 18.8
  roomdata_rand$county[203] <- "Los Angeles_CA"
  roomdata_rand$trumpvote[203] <- 23.4
  roomdata_rand$county[204] <- "Hillsborough_FL"
  roomdata_rand$trumpvote[204] <- 44.7
  roomdata_rand$county[205] <- "Miami-Dade_FL"
  roomdata_rand$trumpvote[205] <- 34.1
  roomdata_rand$county[206] <- "Greenville_SC"
  roomdata_rand$trumpvote[206] <- 59.4
  roomdata_rand$county[207] <- "BexarCounty_TX"
  roomdata_rand$trumpvote[207] <- 41
  roomdata_rand$county[208] <- "Pasquotank_NC"
  roomdata_rand$trumpvote[208] <- 47.6
  roomdata_rand$county[209] <- "Montgomery_PA"
  roomdata_rand$trumpvote[209] <- 37.6
  roomdata_rand$county[210] <- "King_WA"
  roomdata_rand$trumpvote[210] <- 21.7
  roomdata_rand$county[211] <- "Carroll_GA"
  roomdata_rand$trumpvote[211] <- 68.5
  roomdata_rand$county[212] <- "Onondaga_NY"
  roomdata_rand$trumpvote[212] <- 40.8
  roomdata_rand$county[213] <- "Jasper_MO"
  roomdata_rand$trumpvote[213] <- 72.8
  roomdata_rand$county[214] <- "Clinton_NY"
  roomdata_rand$trumpvote[214] <- 46.4
  roomdata_rand$county[215] <- "St. Clair_IL"
  roomdata_rand$trumpvote[215] <- 44.9
  roomdata_rand$county[216] <- "New Haven_CT"
  roomdata_rand$trumpvote[216] <- 42.1
  roomdata_rand$county[217] <- "Volusia_FL"
  roomdata_rand$trumpvote[217] <- 54.8
  roomdata_rand$county[218] <- "Philadelphia_PA"
  roomdata_rand$trumpvote[218] <- 15.5
  roomdata_rand$county[219] <- "Monongalia_WV"
  roomdata_rand$trumpvote[219] <- 51.2
  roomdata_rand$county[220] <- "New York_NY"
  roomdata_rand$trumpvote[220] <- 10
  roomdata_rand$county[221] <- "Plymouth_MA"
  roomdata_rand$trumpvote[221] <- 43.4
  roomdata_rand$county[222] <- "Saline_KS"
  roomdata_rand$trumpvote[222] <- 63
  roomdata_rand$county[223] <- "Forsyth_NC"
  roomdata_rand$trumpvote[223] <- 43.4
  roomdata_rand$county[224] <- "Kent_MD"
  roomdata_rand$trumpvote[224] <- 50.2
  roomdata_rand$county[225] <- "Cambria_PA"
  roomdata_rand$trumpvote[225] <- 67.5
  roomdata_rand$county[226] <- "Hinds_MS"
  roomdata_rand$trumpvote[226] <- 27.2
  roomdata_rand$county[227] <- "Gallatin_MT"
  roomdata_rand$trumpvote[227] <- 44.6
  roomdata_rand$county[228] <- "Jackson_IL"
  roomdata_rand$trumpvote[228] <- 44.4
  roomdata_rand$county[229] <-  "Baltimore City_MD"
  roomdata_rand$trumpvote[229] <- 10.9
  roomdata_rand$county[230] <- "Walla Walla_WA"
  roomdata_rand$trumpvote[230] <- 54.6
  roomdata_rand$county[231] <- "Montgomery_OH"
  roomdata_rand$trumpvote[231] <- 48.4
  roomdata_rand$county[232] <- "Lewis_WA"
  roomdata_rand$trumpvote[232] <- 65.1
  roomdata_rand$county[233] <- "St. Lawrence_NY"
  roomdata_rand$trumpvote[233] <- 52.5
  roomdata_rand$county[234] <- "Baltimore City_MD"
  roomdata_rand$trumpvote[234] <- 10.9
  roomdata_rand$county[235] <- "Bristol_RI"
  roomdata_rand$trumpvote[235] <- 36
  roomdata_rand$county[236] <- "Palm Beach_FL"
  roomdata_rand$trumpvote[236] <- 41.2
  roomdata_rand$county[237] <- "Richmond City_VA"
  roomdata_rand$trumpvote[237] <- 15
  roomdata_rand$county[238] <- "GuilfordCounty_NC"
  roomdata_rand$trumpvote[238] <- 38.7
  roomdata_rand$county[239] <- "LosAngelesCounty_CA"
  roomdata_rand$trumpvote[239] <- 23.4
  roomdata_rand$county[240] <- "Forsyth_NC"
  roomdata_rand$trumpvote[240] <- 43.4
  roomdata_rand$county[241] <- "Durham_NC"
  roomdata_rand$trumpvote[241] <- 18.5
  roomdata_rand$county[242] <- "McPherson_KS"
  roomdata_rand$trumpvote[242] <- 67.6
  roomdata_rand$county[243] <- "Delaware_PA"
  roomdata_rand$trumpvote[243] <- 37.4
  roomdata_rand$county[244] <- "Greene_MO"
  roomdata_rand$trumpvote[244] <- 60.6
  roomdata_rand$county[245] <- "Pierce_WI"
  roomdata_rand$trumpvote[245] <- 53.4
  roomdata_rand$county[246] <- "Suffolk_MA"
  roomdata_rand$trumpvote[246] <- 16.5
  roomdata_rand$county[247] <- "Los Angeles_CA"
  roomdata_rand$trumpvote[247] <- 23.4
  roomdata_rand$county[248] <- "Glynn_GA"
  roomdata_rand$trumpvote[248] <- 63.1
  roomdata_rand$county[249] <- "Albany_NY"
  roomdata_rand$trumpvote[249] <- 35.2
  roomdata_rand$county[250] <- "Leon_FL"
  roomdata_rand$trumpvote[250] <- 35.4
  roomdata_rand$county[251] <- "AlleghenyCounty_PA"
  roomdata_rand$trumpvote[251] <- 40
  roomdata_rand$county[252] <- "St. Lucie_FL"
  roomdata_rand$trumpvote[252] <- 49.9
  roomdata_rand$county[253] <- "Hinds_MS"
  roomdata_rand$trumpvote[253] <- 27.2
  roomdata_rand$county[254] <- "Berkshire_MA"
  roomdata_rand$trumpvote[254] <- 26
  roomdata_rand$county[255] <- "New York_NY"
  roomdata_rand$trumpvote[255] <- 10
  roomdata_rand$county[256] <- "Payne_OK"
  roomdata_rand$trumpvote[256] <- 60
  roomdata_rand$county[257] <- "Alaska"
  roomdata_rand$trumpvote[257] <- 51.28
  roomdata_rand$county[258] <- "Macon_IL"
  roomdata_rand$trumpvote[258] <- 56.6
  roomdata_rand$county[259] <- "Fulton_GA"
  roomdata_rand$trumpvote[259] <- 27.1
  roomdata_rand$county[260] <- "Greene_PA"
  roomdata_rand$trumpvote[260] <- 69.5
  roomdata_rand$county[261] <- "Vernon_MO"
  roomdata_rand$trumpvote[261] <- 76.1
  roomdata_rand$county[262] <- "Knox_IN"
  roomdata_rand$trumpvote[262] <- 71.5
  roomdata_rand$county[263] <- "Buncombe_NC"
  roomdata_rand$trumpvote[263] <- 41.1
  roomdata_rand$county[264] <- "Hamilton_OH"
  roomdata_rand$trumpvote[264] <- 43
  roomdata_rand$county[265] <- "Bucks_PA"
  roomdata_rand$trumpvote[265] <- 47.8
  roomdata_rand$county[266] <- "Alameda_CA"
  roomdata_rand$trumpvote[266] <- 14.9
  roomdata_rand$county[267] <- "Washington_OK"
  roomdata_rand$trumpvote[267] <- 71.2
  roomdata_rand$county[268] <- "Delaware_IN"
  roomdata_rand$trumpvote[268] <- 54.2
  roomdata_rand$county[269] <- "Carroll_MD"
  roomdata_rand$trumpvote[269] <- 65.5
  roomdata_rand$county[270] <- "Delaware_PA"
  roomdata_rand$trumpvote[270] <- 37.4
  roomdata_rand$county[271] <- "Natchitoches_LA"
  roomdata_rand$trumpvote[271] <- 54
  roomdata_rand$county[272] <- "St. Joseph_IN"
  roomdata_rand$trumpvote[272] <- 47.5
  roomdata_rand$county[273] <- "Ozaukee_WI"
  roomdata_rand$trumpvote[273] <- 57.1
  roomdata_rand$county[274] <- "CuyahogaCounty_OH" 
  roomdata_rand$trumpvote[274] <- 30.8
  roomdata_rand$county[275] <- "Mecklenburg_NC"
  roomdata_rand$trumpvote[275] <- 33.4
  roomdata_rand$county[276] <- "Chatham_GA"
  roomdata_rand$trumpvote[276] <- 41.2
  roomdata_rand$county[277] <- "Wayne_IN"
  roomdata_rand$trumpvote[277] <- 62.7
  roomdata_rand$county[278] <- "Kent_MI"
  roomdata_rand$trumpvote[278] <- 48.3
  roomdata_rand$county[279] <- "San Bernardino_CA"
  roomdata_rand$trumpvote[279] <- 42.4
  roomdata_rand$county[280] <- "CamdenCounty_NJ"
  roomdata_rand$trumpvote[280] <- 32
  roomdata_rand$county[281] <- "Manatee_FL"
  roomdata_rand$trumpvote[281] <- 57
  roomdata_rand$county[282] <- "Benton_AR"
  roomdata_rand$trumpvote[282] <- 62.9
  roomdata_rand$county[283] <- "Dakota_MN"
  roomdata_rand$trumpvote[283] <- 43.7
  roomdata_rand$county[284] <- "Hennepin_MN"
  roomdata_rand$trumpvote[284] <- 28.5
  roomdata_rand$county[285] <- "St. Lawrence_NY"
  roomdata_rand$trumpvote[285] <- 52.5
  roomdata_rand$county[286] <- "Madison_NC"
  roomdata_rand$trumpvote[286] <- 61.4
  roomdata_rand$county[287] <- "Woodford_KY"
  roomdata_rand$trumpvote[287] <- 56.8
  roomdata_rand$county[288] <- "Prince George's_MD"
  roomdata_rand$trumpvote[288] <- 8.3
  roomdata_rand$county[289] <- "Walker_TX"
  roomdata_rand$trumpvote[289] <- 65.4
  roomdata_rand$county[290] <- "Delaware_PA"
  roomdata_rand$trumpvote[290] <- 37.4
  roomdata_rand$county[291] <- "Cook_IL"
  roomdata_rand$trumpvote[291] <- 21.4
  roomdata_rand$county[292] <- "Erie_NY"
  roomdata_rand$trumpvote[292] <- 45.4
  roomdata_rand$county[293] <- "Kitsap_WA"
  roomdata_rand$trumpvote[293] <- 39.4
  roomdata_rand$county[294] <- "Yates_NY"
  roomdata_rand$trumpvote[294] <- 57.7
  roomdata_rand$county[295] <- "Johnson_AR"
  roomdata_rand$trumpvote[295] <- 66.8
  roomdata_rand$county[296] <- "Bucks_PA"
  roomdata_rand$trumpvote[296] <- 47.8
  roomdata_rand$county[297] <- "La Plata_CO"
  roomdata_rand$trumpvote[297] <- 40.6
  roomdata_rand$county[298] <- "Grant_IN"
  roomdata_rand$trumpvote[298] <- 67.4
  roomdata_rand$county[299] <- "Eau Claire_WI"
  roomdata_rand$trumpvote[299] <- 43.1
  
  roomdata_rand$county[300] <- "Windham_VT"
  roomdata_rand$trumpvote[300] <- 25.8
  roomdata_rand$county[301] <- "Carson_City_NV"
  roomdata_rand$trumpvote[301] <- 52.5
  roomdata_rand$county[302] <- "Petersburg City_VA"
  roomdata_rand$trumpvote[302] <- 10.6
  roomdata_rand$county[303] <- "Guilford_NC"
  roomdata_rand$trumpvote[303] <- 38.7
  roomdata_rand$county[304] <- "Floyd_GA"
  roomdata_rand$trumpvote[304] <- 70.2 
  roomdata_rand$county[305] <- "Berkshire_MA"
  roomdata_rand$trumpvote[305] <- 26
  roomdata_rand$county[306] <- "Essex_MA"
  roomdata_rand$trumpvote[306] <- 36
  roomdata_rand$county[307] <- "Tompkins_NY"
  roomdata_rand$trumpvote[307] <- 25.6
  roomdata_rand$county[308] <- "Buena Vista City_VA"
  roomdata_rand$trumpvote[308] <- 59.8
  roomdata_rand$county[309] <- "Sumner_TN"
  roomdata_rand$trumpvote[309] <- 70.5
  roomdata_rand$county[310] <- "Monroe_NY"
  roomdata_rand$trumpvote[310] <- 40.3
  roomdata_rand$county[311] <- "Broward_FL"
  roomdata_rand$trumpvote[311] <- 31.4
  roomdata_rand$county[312] <- "Fulton_GA"
  roomdata_rand$trumpvote[312] <- 27.1
  roomdata_rand$county[313] <- "Santa Barbara_CA"
  roomdata_rand$trumpvote[313] <- 32.7
  roomdata_rand$county[314] <- "DuPage_IL"
  roomdata_rand$trumpvote[314] <- 39.8
  roomdata_rand$county[315] <- "Houghton_MI"
  roomdata_rand$trumpvote[315] <- 54.2
  roomdata_rand$county[316] <- "Whitfield_GA"
  roomdata_rand$trumpvote[316] <- 70.9
  roomdata_rand$county[317] <- "Cook_IL"
  roomdata_rand$trumpvote[317] <- 21.4
  roomdata_rand$county[318] <- "Worcester_MA"
  roomdata_rand$trumpvote[318] <- 41.2
  roomdata_rand$county[319] <- "Vigo_IN"
  roomdata_rand$trumpvote[319] <- 55.4
  roomdata_rand$county[320] <- "Rutherford_TN"
  roomdata_rand$trumpvote[320] <- 60.5
  roomdata_rand$county[321] <- "Charleston_SC"
  roomdata_rand$trumpvote[321] <- 42.8
  roomdata_rand$county[322] <- "Erie_PA"
  roomdata_rand$trumpvote[322] <- 48.8
  roomdata_rand$county[323] <- "Madison_KY"
  roomdata_rand$trumpvote[323] <- 62.8
  roomdata_rand$county[324] <- "Orange_CA"
  roomdata_rand$trumpvote[324] <- 43.3
  roomdata_rand$county[325] <- "Livingston_NY"
  roomdata_rand$trumpvote[325] <- 61.3
  roomdata_rand$county[326] <- "Howard_MO"
  roomdata_rand$trumpvote[326] <- 67.6
  roomdata_rand$county[327] <- "Denton_TX"
  roomdata_rand$trumpvote[327] <- 57.7
  roomdata_rand$county[328] <- "Napa_CA"
  roomdata_rand$trumpvote[328] <- 29.6
  roomdata_rand$county[329] <- "Coconino_AZ"
  roomdata_rand$trumpvote[329] <- 36.9
  roomdata_rand$county[330] <- "McMinn_TN"
  roomdata_rand$trumpvote[330] <- 78.5
  roomdata_rand$county[331] <- "Westchester_NY"
  roomdata_rand$trumpvote[331] <- 32.1
  roomdata_rand$county[332] <- "Allegany_NY"
  roomdata_rand$trumpvote[332] <- 68.4
  roomdata_rand$county[333] <- "Allegheny_PA"
  roomdata_rand$trumpvote[333] <- 40
  roomdata_rand$county[334] <- "Jefferson_KY"
  roomdata_rand$trumpvote[334] <- 41.7
  roomdata_rand$county[335] <- "Baltimore City_MD"
  roomdata_rand$trumpvote[335] <- 10.9
  roomdata_rand$county[336] <- "Richmond City_VA"
  roomdata_rand$trumpvote[336] <- 15
  roomdata_rand$county[337] <- "Erie_NY"
  roomdata_rand$trumpvote[337] <- 45.4
  roomdata_rand$county[338] <- "Allegheny_PA"
  roomdata_rand$trumpvote[338] <- 40
  roomdata_rand$county[339] <- "Allegany_NY"
  roomdata_rand$trumpvote[339] <- 68.4
  roomdata_rand$county[340] <- "MultnomahCounty_OR"
  roomdata_rand$trumpvote[340] <- 17.6
  roomdata_rand$county[341] <- "ProvidenceCounty_RI"
  roomdata_rand$trumpvote[341] <- 37
  roomdata_rand$county[342] <- "Travis_TX"
  roomdata_rand$trumpvote[342] <- 27.4
  roomdata_rand$county[343] <- "Beaver_PA"
  roomdata_rand$trumpvote[343] <- 58.3
  roomdata_rand$county[344] <- "Bibb_GA"
  roomdata_rand$trumpvote[344] <- 38.7
  roomdata_rand$county[345] <- "Warren_IL"
  roomdata_rand$trumpvote[345] <- 55.4
  roomdata_rand$county[346] <- "Greene_MO"
  roomdata_rand$trumpvote[346] <- 60.6
  roomdata_rand$county[347] <- "Nassau_NY"
  roomdata_rand$trumpvote[347] <- 45.9
  roomdata_rand$county[348] <- "Washington_ME"
  roomdata_rand$trumpvote[348] <- 54.6
  roomdata_rand$county[349] <- "Dutchess_NY"
  roomdata_rand$trumpvote[349] <- 48.4
  roomdata_rand$county[350] <- "Baldwin_GA"
  roomdata_rand$trumpvote[350] <- 47.8
  roomdata_rand$county[351] <- "OrleansParish_LA"
  roomdata_rand$trumpvote[351] <- 14.7
  roomdata_rand$county[352] <- "St. Louis_MO"
  roomdata_rand$trumpvote[352] <- 39.5
  roomdata_rand$county[353] <- "Jefferson_WV"
  roomdata_rand$trumpvote[353] <- 54.8
  roomdata_rand$county[354] <- "Richmond City_VA"
  roomdata_rand$trumpvote[354] <- 15
  roomdata_rand$county[355] <- "Forrest_MS"
  roomdata_rand$trumpvote[355] <- 55.5
  roomdata_rand$county[356] <- "Durham_NC"
  roomdata_rand$trumpvote[356] <- 18.5
  roomdata_rand$county[357] <- "White_AR"
  roomdata_rand$trumpvote[357] <- 75.3
  roomdata_rand$county[358] <- "Ector_TX"
  roomdata_rand$trumpvote[358] <- 68.7
  roomdata_rand$county[359] <- "Walla Walla_WA"
  roomdata_rand$trumpvote[359] <- 54.6
  roomdata_rand$county[360] <- "Sioux_IA"
  roomdata_rand$trumpvote[360] <- 82.1
  roomdata_rand$county[361] <- "Pinellas_FL"
  roomdata_rand$trumpvote[361] <- 48.6
  roomdata_rand$county[362] <- "St.JosephCounty_IN"
  roomdata_rand$trumpvote[362] <- 47.5
  roomdata_rand$county[363] <- "St. Mary's_MD"
  roomdata_rand$trumpvote[363] <- 59.5
  roomdata_rand$county[364] <- "Hawaii_HI"
  roomdata_rand$trumpvote[364] <- 27.1
  roomdata_rand$county[365] <- "Lubbock_TX"
  roomdata_rand$trumpvote[365] <- 66.9
  roomdata_rand$county[366] <- "Pottawatomie_OK"
  roomdata_rand$trumpvote[366] <- 70.1
  roomdata_rand$county[367] <- "Ramsey_MN"
  roomdata_rand$trumpvote[367] <- 26.3
  roomdata_rand$county[368] <- "King_WA"
  roomdata_rand$trumpvote[368] <- 21.7
  roomdata_rand$county[369] <- "Greene_MO"
  roomdata_rand$trumpvote[369] <- 60.6
  roomdata_rand$county[370] <- "Okmulgee_OK"
  roomdata_rand$trumpvote[370] <- 64.1
  roomdata_rand$county[371] <- "Cumberland_PA"
  roomdata_rand$trumpvote[371] <- 57.1
  roomdata_rand$county[372] <- "Crawford_PA"
  roomdata_rand$trumpvote[372] <- 67.2
  roomdata_rand$county[373] <- "Cumberland_ME"
  roomdata_rand$trumpvote[373] <- 33.7
  roomdata_rand$county[374] <- "Hampshire_MA"
  roomdata_rand$trumpvote[374] <- 26.8
  roomdata_rand$county[375] <- "Callaway_MO"
  roomdata_rand$trumpvote[375] <- 68.2
  roomdata_rand$county[376] <- "MilwaukeeCounty_WI"
  roomdata_rand$trumpvote[376] <- 29
  roomdata_rand$county[377] <- "Wilson_NC"
  roomdata_rand$trumpvote[377] <- 46.3
  roomdata_rand$county[378] <- "Monterey_CA"
  roomdata_rand$trumpvote[378] <- 27.3
  roomdata_rand$county[379] <- "Hampshire_MA"
  roomdata_rand$trumpvote[379] <- 26.8
  roomdata_rand$county[380] <- "Harvey_KS"
  roomdata_rand$trumpvote[380] <- 58.5
  roomdata_rand$county[381] <- "Jefferson_AL"
  roomdata_rand$trumpvote[381] <- 45
  roomdata_rand$county[382] <- "St. Louis_MN"
  roomdata_rand$trumpvote[382] <- 40.1
  roomdata_rand$county[383] <- "Clarke_GA"
  roomdata_rand$trumpvote[383] <- 28.3
  roomdata_rand$county[384] <- "Highlands_FL"
  roomdata_rand$trumpvote[384] <- 64.7
  roomdata_rand$county[385] <- "Winnebago_IL"
  roomdata_rand$trumpvote[385] <- 47.7
  roomdata_rand$county[386] <- "Marion_IN"
  roomdata_rand$trumpvote[386] <- 36.1
  roomdata_rand$county[387] <- "Baltimore City_MD"
  roomdata_rand$trumpvote[387] <- 10.9
  roomdata_rand$county[388] <- "New York_NY"
  roomdata_rand$trumpvote[388] <- 10
  roomdata_rand$county[389] <- "Schenectady_NY"
  roomdata_rand$trumpvote[389] <- 44.2
  roomdata_rand$county[390] <- "Shelby_TN"
  roomdata_rand$trumpvote[390] <- 34.6
  roomdata_rand$county[391] <- "Blue Earth_MN"
  roomdata_rand$trumpvote[391] <- 47.1
  roomdata_rand$county[392] <- "Seminole_FL"
  roomdata_rand$trumpvote[392] <- 48.7
  roomdata_rand$county[393] <- "San_Diego_CA"
  roomdata_rand$trumpvote[393] <- 38.2
  roomdata_rand$county[394] <- "Tarrant_TX"
  roomdata_rand$trumpvote[394] <- 52.2
  roomdata_rand$county[395] <- "Worcester_MA"
  roomdata_rand$trumpvote[395] <- 41.2
  roomdata_rand$county[396] <- "Santa Clara_CA"
  roomdata_rand$trumpvote[396] <- 20.9
  roomdata_rand$county[397] <- "Giles_TN"
  roomdata_rand$trumpvote[397] <- 71.6
  roomdata_rand$county[398] <- "Lincoln_LA"
  roomdata_rand$trumpvote[398] <- 57.7
  roomdata_rand$county[399] <- "Worcester_MA"
  roomdata_rand$trumpvote[399] <- 41.2
  
  roomdata_rand$county[400] <- "Solano_CA"
  roomdata_rand$trumpvote[400] <- 31.8
  roomdata_rand$county[401] <- "HennepinCounty_MN"
  roomdata_rand$trumpvote[401] <- 28.5
  roomdata_rand$county[402] <- "Virginia Beach_VA"
  roomdata_rand$trumpvote[402] <- 49.1
  roomdata_rand$county[403] <- "YellowstoneCounty_MT"
  roomdata_rand$trumpvote[403] <- 59.6
  roomdata_rand$county[404] <- "Lea_NM"
  roomdata_rand$trumpvote[404] <- 70.5
  roomdata_rand$county[405] <- "Hillsborough_NH"
  roomdata_rand$trumpvote[405] <- 47.5
  roomdata_rand$county[406] <- "Hertford_NC"
  roomdata_rand$trumpvote[406] <- 30.5
  roomdata_rand$county[407] <- "Daviess_KY"
  roomdata_rand$trumpvote[407] <- 63.1
  roomdata_rand$county[408] <- "Genesee_MI"
  roomdata_rand$trumpvote[408] <- 42.9
  roomdata_rand$county[409] <- "Tulsa_OK"
  roomdata_rand$trumpvote[409] <- 58.4
  roomdata_rand$county[410] <- "Orange_CA"
  roomdata_rand$trumpvote[410] <- 44.8
  roomdata_rand$county[411] <- "Honolulu_HI"
  roomdata_rand$trumpvote[411] <- 31.7
  roomdata_rand$county[412] <- "Kent_RI"
  roomdata_rand$trumpvote[412] <- 47.8
  roomdata_rand$county[413] <- "Lake_IL"
  roomdata_rand$trumpvote[413] <- 37
  roomdata_rand$county[414] <- "Pueblo_CO"
  roomdata_rand$trumpvote[414] <- 46.2
  roomdata_rand$county[415] <- "Dakota_MN"
  roomdata_rand$trumpvote[415] <- 43.7
  roomdata_rand$county[416] <- "Muscogee_GA"
  roomdata_rand$trumpvote[416] <- 39.4
  roomdata_rand$county[417] <- "Montgomery_VA"
  roomdata_rand$trumpvote[417] <- 45.6
  roomdata_rand$county[418] <- "Black Hawk_IA"
  roomdata_rand$trumpvote[418] <- 43.3
  roomdata_rand$county[419] <- "Rensselaer_NY"
  roomdata_rand$trumpvote[419] <- 48.4
  roomdata_rand$county[420] <- "Los Angeles_CA"
  roomdata_rand$trumpvote[420] <- 23.4
  roomdata_rand$county[421] <- "Volusia_FL"
  roomdata_rand$trumpvote[421] <- 54.8
  roomdata_rand$county[422] <- "Kent_MI"
  roomdata_rand$trumpvote[422] <- 48.3
  roomdata_rand$county[423] <- "Union_PA"
  roomdata_rand$trumpvote[423] <- 60.9
  roomdata_rand$county[424] <- "Taylor_KY"
  roomdata_rand$trumpvote[424] <- 73.6
  roomdata_rand$county[425] <- "Harrisonburg_VA"
  roomdata_rand$trumpvote[425] <- 35.2
  roomdata_rand$county[426] <- "Lancaster_PA"
  roomdata_rand$trumpvote[426] <- 57.3
  roomdata_rand$county[427] <- "St. Louis_MO"
  roomdata_rand$trumpvote[427] <- 39.5
  roomdata_rand$county[428] <- "RamseyCounty_MN"
  roomdata_rand$trumpvote[428] <- 26.3
  roomdata_rand$county[429] <- "Stutsman_ND"
  roomdata_rand$trumpvote[429] <- 67.5
  roomdata_rand$county[430] <- "Seneca_OH"
  roomdata_rand$trumpvote[430] <- 62
  roomdata_rand$county[431] <- "San Joaquin_CA"
  roomdata_rand$trumpvote[431] <- 41
  roomdata_rand$county[432] <- "Pima_AZ"
  roomdata_rand$trumpvote[432] <- 41
  roomdata_rand$county[433] <- "BooneCounty_MO"
  roomdata_rand$trumpvote[433] <- 43.4
  roomdata_rand$county[434] <- "Westchester_NY"
  roomdata_rand$trumpvote[434] <- 32.1
  roomdata_rand$county[435] <- "Davidson_TN"
  roomdata_rand$trumpvote[435] <- 34.3
  roomdata_rand$county[436] <- "Cortland_NY"
  roomdata_rand$trumpvote[436] <- 50
  roomdata_rand$county[437] <- "BexarCounty_TX"
  roomdata_rand$trumpvote[437] <- 41
  roomdata_rand$county[438] <- "McPherson_KS"
  roomdata_rand$trumpvote[438] <- 67.6
  roomdata_rand$county[439] <- "Ontario_NY"
  roomdata_rand$trumpvote[439] <- 51.1
  roomdata_rand$county[440] <- "Hale_TX"
  roomdata_rand$trumpvote[440] <- 72.1
  roomdata_rand$county[441] <- "Portage_OH"
  roomdata_rand$trumpvote[441] <- 52.7
  roomdata_rand$county[442] <- "MaricopaCounty_AZ"
  roomdata_rand$trumpvote[442] <- 49
  roomdata_rand$county[443] <- "LynchburgCity_VA"
  roomdata_rand$trumpvote[443] <- 50.9
  roomdata_rand$county[444] <- "Monroe_PA"
  roomdata_rand$trumpvote[444] <- 48.1
  roomdata_rand$county[445] <- "Marin_CA"
  roomdata_rand$trumpvote[445] <- 16.1
  roomdata_rand$county[446] <- "LucasCounty_OH"
  roomdata_rand$trumpvote[446] <- 39
  roomdata_rand$county[447] <- "Sebastian_AR"
  roomdata_rand$trumpvote[447] <- 65.2
  roomdata_rand$county[448] <- "Shelby_TN"
  roomdata_rand$trumpvote[448] <- 34.6
  roomdata_rand$county[449] <- "Rockland_NY"
  roomdata_rand$trumpvote[449] <- 46.1
  roomdata_rand$county[450] <- "Grant_WI"
  roomdata_rand$trumpvote[450] <- 51.3
  roomdata_rand$county[451] <- "Cook_IL"
  roomdata_rand$trumpvote[451] <- 21.4
  roomdata_rand$county[452] <- "Washtenaw_MI"
  roomdata_rand$trumpvote[452] <- 26.9
  roomdata_rand$county[453] <- "Utah_UT"
  roomdata_rand$trumpvote[453] <- 51.5
  roomdata_rand$county[454] <- "Snyder_PA"
  roomdata_rand$trumpvote[454] <- 71.7
  roomdata_rand$county[455] <- "Madison_ID"
  roomdata_rand$trumpvote[455] <- 57
  roomdata_rand$county[456] <- "Huntington_IN"
  roomdata_rand$trumpvote[456] <- 72.9
  roomdata_rand$county[457] <- "Thurston_WA"
  roomdata_rand$trumpvote[457] <- 38
  roomdata_rand$county[458] <- "Franklin_GA"
  roomdata_rand$trumpvote[458] <- 83.2
  roomdata_rand$county[459] <- "Chester_PA"
  roomdata_rand$trumpvote[459] <- 43.3
  roomdata_rand$county[460] <- "Garfield_CO"
  roomdata_rand$trumpvote[460] <- 49.6
  roomdata_rand$county[461] <- "Middlesex_MA"
  roomdata_rand$trumpvote[461] <- 28.2
  roomdata_rand$county[462] <- "TravisCounty_TX"
  roomdata_rand$trumpvote[462] <- 27.4
  roomdata_rand$county[463] <- "St. Louis_MO"
  roomdata_rand$trumpvote[463] <- 39.5
  roomdata_rand$county[464] <- "Bennington_VT"
  roomdata_rand$trumpvote[464] <- 36.2
  roomdata_rand$county[465] <- "Clallam_WA"
  roomdata_rand$trumpvote[465] <- 47.6
  roomdata_rand$county[466] <- "Kennebec_ME"
  roomdata_rand$trumpvote[466] <- 48.1
  roomdata_rand$county[467] <- "CookCounty_IL"
  roomdata_rand$trumpvote[467] <- 21.4
  roomdata_rand$county[468] <- "Saline_MO"
  roomdata_rand$trumpvote[468] <- 64.7
  roomdata_rand$county[469] <- "Dubuque_IA"
  roomdata_rand$trumpvote[469] <- 47.7
  roomdata_rand$county[470] <- "Anderson_SC"
  roomdata_rand$trumpvote[470] <- 69.9
  roomdata_rand$county[471] <- "Kennebec_ME"
  roomdata_rand$trumpvote[471] <- 48.1
  roomdata_rand$county[472] <- "Merrimack_NH"
  roomdata_rand$trumpvote[472] <- 45.9
  roomdata_rand$county[473] <- "Franklin_NY"
  roomdata_rand$trumpvote[473] <- 50.4
  roomdata_rand$county[474] <- "Wayne_OH"
  roomdata_rand$trumpvote[474] <- 65.1
  roomdata_rand$county[475] <- "Canyon_ID"
  roomdata_rand$trumpvote[475] <- 65
  roomdata_rand$county[476] <- "Los Angeles_CA"
  roomdata_rand$trumpvote[476] <- 23.4
  roomdata_rand$county[477] <- "Oklahoma_OK"
  roomdata_rand$trumpvote[477] <- 51.7
  roomdata_rand$county[478] <- "Taylor_TX"
  roomdata_rand$trumpvote[478] <- 73.3
  roomdata_rand$county[479] <- "Calhoun_MI"
  roomdata_rand$trumpvote[479] <- 53.6
  roomdata_rand$county[480] <- "Lawrence_SD"
  roomdata_rand$trumpvote[480] <- 62.6
  roomdata_rand$county[481] <- "RamseyCounty_MN"
  roomdata_rand$trumpvote[481] <- 26.3
  roomdata_rand$county[482] <- "Yavapai_AZ"
  roomdata_rand$trumpvote[482] <- 63.5
  roomdata_rand$county[483] <- "PhiladelphiaCounty_PA" 
  roomdata_rand$trumpvote[483] <- 15.5
  roomdata_rand$county[484] <- "Kittitas_WA"
  roomdata_rand$trumpvote[484] <- 53.7
  roomdata_rand$county[485] <- "Waller_TX"
  roomdata_rand$trumpvote[485] <- 63
  roomdata_rand$county[486] <- "Riverside_CA"
  roomdata_rand$trumpvote[486] <- 46.7
  roomdata_rand$county[487] <- "Woods_OK"
  roomdata_rand$trumpvote[487] <- 80.4
  roomdata_rand$county[488] <- "Los Angeles_CA"
  roomdata_rand$trumpvote[488] <- 23.4
  roomdata_rand$county[489] <- "Middlesex_MA"
  roomdata_rand$trumpvote[489] <- 28.2
  roomdata_rand$county[490] <- "Wood_OH"
  roomdata_rand$trumpvote[490] <- 50.9
  roomdata_rand$county[491] <- "Kern_CA"
  roomdata_rand$trumpvote[491] <- 54.7
  roomdata_rand$county[492] <- "Oklahoma_OK"
  roomdata_rand$trumpvote[492] <- 51.7
  roomdata_rand$county[493] <- "Macon_AL"
  roomdata_rand$trumpvote[493] <- 15.9
  roomdata_rand$county[494] <- "CookCounty_IL"
  roomdata_rand$trumpvote[494] <- 21.4
  roomdata_rand$county[495] <- "St. Louis_MN"
  roomdata_rand$trumpvote[495] <- 40.1
  roomdata_rand$county[496] <- "Salt Lake_UT"
  roomdata_rand$trumpvote[496] <- 32.6
  roomdata_rand$county[497] <- "Los Angeles_CA"
  roomdata_rand$trumpvote[497] <- 23.4
  roomdata_rand$county[498] <- "Knott_KY"
  roomdata_rand$trumpvote[498] <- 75.6
  roomdata_rand$county[499] <- "Hinds_MS"
  roomdata_rand$trumpvote[499] <- 26.9
  
    roomdata_rand$county[500] <- "Dupage_IL"
    roomdata_rand$trumpvote[500] <- 39.8
    roomdata_rand$county[501] <- "St. Lawrence_NY"
    roomdata_rand$trumpvote[501] <- 52.5
    roomdata_rand$county[502] <- "New Haven_CT"
    roomdata_rand$trumpvote[502] <- 42.1
    roomdata_rand$county[503] <- "Licking_OH"
    roomdata_rand$trumpvote[503] <- 62.1
    roomdata_rand$county[504] <- "Tolland_CT"
    roomdata_rand$trumpvote[504] <- 44.1
    roomdata_rand$county[505] <- "Oklahoma_OK"
    roomdata_rand$trumpvote[505] <- 51.7
    roomdata_rand$county[506] <- "Yellowstone_MT"
    roomdata_rand$trumpvote[506] <- 59.6
    roomdata_rand$county[507] <- "Allegheny_PA"
    roomdata_rand$trumpvote[507] <- 40
    roomdata_rand$county[508] <- "San_Diego_CA"
    roomdata_rand$trumpvote[508] <- 38.2
    roomdata_rand$county[509] <- "Allegany_MD"
    roomdata_rand$trumpvote[509] <- 72
    roomdata_rand$county[510] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[510] <- 23.4
    roomdata_rand$county[511] <- "McLean_IL"
    roomdata_rand$trumpvote[511] <- 46.9
    roomdata_rand$county[512] <- "Mercer_PA"
    roomdata_rand$trumpvote[512] <- 60.6
    roomdata_rand$county[513] <- "Pierce_WA"
    roomdata_rand$trumpvote[513] <- 42.3
    roomdata_rand$county[514] <- "Middlesex_MA"
    roomdata_rand$trumpvote[514] <- 28.2
    roomdata_rand$county[515] <- "Buena Vista_IA"
    roomdata_rand$trumpvote[515] <- 59.8
    roomdata_rand$county[516] <- "Allegheny_PA"
    roomdata_rand$trumpvote[516] <- 40
    roomdata_rand$county[517] <- "Fairfield_CT"
    roomdata_rand$trumpvote[517] <- 37.9
    roomdata_rand$county[518] <- "Cumberland_NC"
    roomdata_rand$trumpvote[518] <- 40.7
    roomdata_rand$county[519] <- "Cape Girardeau_MO"
    roomdata_rand$trumpvote[519] <- 73.1
    roomdata_rand$county[520] <- "Kleberg_TX"
    roomdata_rand$trumpvote[520] <- 46
    roomdata_rand$county[521] <- "Stanly_NC"
    roomdata_rand$trumpvote[521] <- 74
    roomdata_rand$county[522] <- "Providence_RI"
    roomdata_rand$trumpvote[522] <- 37.6
    roomdata_rand$county[523] <- "Johnson_IA"
    roomdata_rand$trumpvote[523] <- 27.8
    roomdata_rand$county[524] <- "OrleansParish_LA"
    roomdata_rand$trumpvote[524] <- 14.7
    roomdata_rand$county[525] <- "Mobile_AL"
    roomdata_rand$trumpvote[525] <- 55.7
    roomdata_rand$county[526] <- "Doña Ana_NM"
    roomdata_rand$trumpvote[526] <- 35.9
    roomdata_rand$county[527] <- "Mercer_WV"
    roomdata_rand$trumpvote[527] <- 75.8
    roomdata_rand$county[528] <- "Will_IL"
    roomdata_rand$trumpvote[528] <- 44.6
    roomdata_rand$county[529] <- "Putnam_IN"
    roomdata_rand$trumpvote[529] <- 72.5
    roomdata_rand$county[530] <- "Rice_KS"
    roomdata_rand$trumpvote[530] <- 74.3
    roomdata_rand$county[531] <- "Johnson_IN"
    roomdata_rand$trumpvote[531] <- 68.6
    roomdata_rand$county[532] <- "Yakima_WA"
    roomdata_rand$trumpvote[532] <- 54.8
    roomdata_rand$county[533] <- "Cobb_GA"
    roomdata_rand$trumpvote[533] <- 46.7
    roomdata_rand$county[534] <- "Orange_CA"
    roomdata_rand$trumpvote[534] <- 43.3
    roomdata_rand$county[535] <- "Alamance_NC"
    roomdata_rand$trumpvote[535] <- 55.2
    roomdata_rand$county[536] <- "Otsego_NY"
    roomdata_rand$trumpvote[536] <- 53.4
    roomdata_rand$county[537] <- "Bremer_IA"
    roomdata_rand$trumpvote[537] <- 53.9
    roomdata_rand$county[538] <- "New Haven_CT"
    roomdata_rand$trumpvote[538] <- 42.1
    roomdata_rand$county[539] <- "Lorain_OH"
    roomdata_rand$trumpvote[539] <- 47.8
    roomdata_rand$county[540] <- "Miami-Dade_FL"
    roomdata_rand$trumpvote[540] <- 34.1
    roomdata_rand$county[541] <- "Buchanan_MO"
    roomdata_rand$trumpvote[541] <- 59.9
    roomdata_rand$county[542] <- "Jefferson_CO"
    roomdata_rand$trumpvote[542] <- 42.2
    roomdata_rand$county[543] <- "Sonoma_CA"
    roomdata_rand$trumpvote[543] <- 22.8
    roomdata_rand$county[544] <- "Wayne_MI"
    roomdata_rand$trumpvote[544] <- 29.4
    roomdata_rand$county[545] <- "McDonough_IL"
    roomdata_rand$trumpvote[545] <- 52.6
    roomdata_rand$county[546] <- "Bay_FL"
    roomdata_rand$trumpvote[546] <- 71.2
    roomdata_rand$county[547] <- "Lowndes_MS"
    roomdata_rand$trumpvote[547] <- 52.2
    roomdata_rand$county[548] <- "Drew_AR"
    roomdata_rand$trumpvote[548] <- 60.2
    roomdata_rand$county[549] <- "PascoCounty_FL"
    roomdata_rand$trumpvote[549] <- 59
    roomdata_rand$county[550] <- "Thomas_GA"
    roomdata_rand$trumpvote[550] <- 59.9
    roomdata_rand$county[551] <- "Schoharie_NY"
    roomdata_rand$trumpvote[551] <- 64.5
    roomdata_rand$county[552] <- "Orangeburg_SC"
    roomdata_rand$trumpvote[552] <- 30.7
    roomdata_rand$county[553] <- "Ashland_OH"
    roomdata_rand$trumpvote[553] <- 71.3
    roomdata_rand$county[554] <- "Allegheny_PA"
    roomdata_rand$trumpvote[554] <- 40
    roomdata_rand$county[555] <- "Williamson_TX"
    roomdata_rand$trumpvote[555] <- 51.9
    roomdata_rand$county[556] <- "Stark_OH"
    roomdata_rand$trumpvote[556] <- 56.4
    roomdata_rand$county[557] <- "Harrison_TX"
    roomdata_rand$trumpvote[557] <- 71
    roomdata_rand$county[558] <- "Maui_HI"
    roomdata_rand$trumpvote[558] <- 26.2
    roomdata_rand$county[559] <- "Portage_OH"
    roomdata_rand$trumpvote[559] <- 52.7
    roomdata_rand$county[560] <- "Buncombe_NC"
    roomdata_rand$trumpvote[560] <- 41.1
    roomdata_rand$county[561] <- "Greene_OH"
    roomdata_rand$trumpvote[561] <- 59.7
    roomdata_rand$county[562] <- "York_PA"
    roomdata_rand$trumpvote[562] <- 62.5
    roomdata_rand$county[563] <- "Clay_MN"
    roomdata_rand$trumpvote[563] <- 46.5
    roomdata_rand$county[564] <- "San_Francisco_CA"
    roomdata_rand$trumpvote[564] <- 9.4
    roomdata_rand$county[565] <- "Washington_VT"
    roomdata_rand$trumpvote[565] <- 27.9
    roomdata_rand$county[566] <- "Clayton_GA"
    roomdata_rand$trumpvote[566] <- 13.2
    roomdata_rand$county[567] <- "Chester_PA"
    roomdata_rand$trumpvote[567] <- 43.3
    roomdata_rand$county[568] <- "SedgwickCounty_KA"
    roomdata_rand$trumpvote[568] <- 56
    roomdata_rand$county[569] <- "Washington_DC"
    roomdata_rand$trumpvote[569] <- 4
    roomdata_rand$county[570] <- "Strafford_NH"
    roomdata_rand$trumpvote[570] <- 42.8
    roomdata_rand$county[571] <- "Davidson_TN"
    roomdata_rand$trumpvote[571] <- 34.3
    roomdata_rand$county[572] <- "OrleansParish_LA"
    roomdata_rand$trumpvote[572] <- 14.7
    roomdata_rand$county[573] <- "Middlesex_CT"
    roomdata_rand$trumpvote[573] <- 43.9
    roomdata_rand$county[574] <- "Santa Barbara_CA"
    roomdata_rand$trumpvote[574] <- 32.7
    roomdata_rand$county[575] <- "Clay_MN"
    roomdata_rand$trumpvote[575] <- 46.5
    roomdata_rand$county[576] <- "Penobscot_ME"
    roomdata_rand$trumpvote[576] <- 51.9
    roomdata_rand$county[577] <- "MonroeCounty_NY"
    roomdata_rand$trumpvote[577] <- 40.3
    roomdata_rand$county[578] <- "Orange_CA"
    roomdata_rand$trumpvote[578] <- 44.8
    roomdata_rand$county[579] <- "Essex_NJ"
    roomdata_rand$trumpvote[579] <- 20.7
    roomdata_rand$county[580] <- "Charleston_SC"
    roomdata_rand$trumpvote[580] <- 42.8
    roomdata_rand$county[581] <- "Worcester_MA"
    roomdata_rand$trumpvote[581] <- 41.2
    roomdata_rand$county[582] <- "Rockland_NY"
    roomdata_rand$trumpvote[582] <- 46.1
    roomdata_rand$county[583] <- "Allegheny_PA"
    roomdata_rand$trumpvote[583] <- 40
    roomdata_rand$county[584] <- "MilwaukeeCounty_WI"
    roomdata_rand$trumpvote[584] <- 29
    roomdata_rand$county[585] <- "Nodaway_MO"
    roomdata_rand$trumpvote[585] <- 67.6
    roomdata_rand$county[586] <- "Weakley_TN"
    roomdata_rand$trumpvote[586] <- 74.2
    roomdata_rand$county[587] <- "RamseyCounty_MN"
    roomdata_rand$trumpvote[587] <- 26.3
    roomdata_rand$county[588] <- "Columbia_PA"
    roomdata_rand$trumpvote[588] <- 64.1
    roomdata_rand$county[589] <- "Troup_GA"
    roomdata_rand$trumpvote[589] <- 60.6
    roomdata_rand$county[590] <- "Lenawee_MI"
    roomdata_rand$trumpvote[590] <- 57.6
    roomdata_rand$county[591] <- "Washington_OH"
    roomdata_rand$trumpvote[591] <- 68.6
    roomdata_rand$county[592] <- "Rhea_TN"
    roomdata_rand$trumpvote[592] <- 79
    roomdata_rand$county[593] <- "Davidson_TN"
    roomdata_rand$trumpvote[593] <- 34.3
    roomdata_rand$county[594] <- "Sumter_SC"
    roomdata_rand$trumpvote[594] <- 42.5
    roomdata_rand$county[595] <- "Lane_OR"
    roomdata_rand$trumpvote[595] <- 36.6
    roomdata_rand$county[596] <- "Winneshiek_IA"
    roomdata_rand$trumpvote[596] <- 47.5
    roomdata_rand$county[597] <- "Utah_UT"
    roomdata_rand$trumpvote[597] <- 51.5
    roomdata_rand$county[598] <- "Aiken_SC"
    roomdata_rand$trumpvote[598] <- 61.5
    roomdata_rand$county[599] <- "Faulkner_AR"
    roomdata_rand$trumpvote[599] <- 61.8
    
    roomdata_rand$county[600] <- "Lamar_GA"
    roomdata_rand$trumpvote[600] <- 68.4
    roomdata_rand$county[601] <- "Norfolk City_VA"
    roomdata_rand$trumpvote[601] <- 26.4
    roomdata_rand$county[602] <- "Boulder_CO"
    roomdata_rand$trumpvote[602] <- 21.9
    roomdata_rand$county[603] <- "Knox_IL"
    roomdata_rand$trumpvote[603] <- 48.5
    roomdata_rand$county[604] <- "Charlottesville City_VA"
    roomdata_rand$trumpvote[604] <- 13.3
    roomdata_rand$county[605] <- "Texas_OK"
    roomdata_rand$trumpvote[605] <- 80
    roomdata_rand$county[606] <- "Jefferson_KY"
    roomdata_rand$trumpvote[606] <- 41.7
    roomdata_rand$county[607] <- "Rowan_NC"
    roomdata_rand$trumpvote[607] <- 67.2
    roomdata_rand$county[608] <- "Bexar_TX"
    roomdata_rand$trumpvote[608] <- 41
    roomdata_rand$county[609] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[609] <- 23.4
    roomdata_rand$county[610] <- "San_Diego_CA"
    roomdata_rand$trumpvote[610] <- 38.2
    roomdata_rand$county[611] <- "Kanawha_WV"
    roomdata_rand$trumpvote[611] <- 58
    roomdata_rand$county[612] <- "Baltimore_MD"
    roomdata_rand$trumpvote[612] <- 39.1
    roomdata_rand$county[613] <- "Bond_IL"
    roomdata_rand$trumpvote[613] <- 65.5
    roomdata_rand$county[614] <- "Hall_GA"
    roomdata_rand$trumpvote[614] <- 73.7
    roomdata_rand$county[615] <- "Smith_TX"
    roomdata_rand$trumpvote[615] <- 70.5
    roomdata_rand$county[616] <- "Peach_GA"
    roomdata_rand$trumpvote[616] <- 50.5
    roomdata_rand$county[617] <- "Scott_IA"
    roomdata_rand$trumpvote[617] <- 46
    roomdata_rand$county[618] <- "Polk_FL"
    roomdata_rand$trumpvote[618] <- 55.4
    roomdata_rand$county[619] <- "HennepinCounty_MN"
    roomdata_rand$trumpvote[619] <- 28.5
    roomdata_rand$county[620] <- "New London_CT"
    roomdata_rand$trumpvote[620] <- 43.8
    roomdata_rand$county[621] <- "Nassau_NY"
    roomdata_rand$trumpvote[621] <- 45.9
    roomdata_rand$county[622] <- "New Haven_CT"
    roomdata_rand$trumpvote[622] <- 42.1
    roomdata_rand$county[623] <- "Lake_IN"
    roomdata_rand$trumpvote[623] <- 37.7
    roomdata_rand$county[624] <- "San_Diego_CA"
    roomdata_rand$trumpvote[624] <- 38.2
    roomdata_rand$county[625] <- "Stark_ND"
    roomdata_rand$trumpvote[625] <- 80.2
    roomdata_rand$county[626] <- "Ingham_MI"
    roomdata_rand$trumpvote[626] <- 33.2
    roomdata_rand$county[627] <- "Orange_CA"
    roomdata_rand$trumpvote[627] <- 43.3
    roomdata_rand$county[628] <- "Campbell_KY"
    roomdata_rand$trumpvote[628] <- 59
    roomdata_rand$county[629] <- "New York_NY"
    roomdata_rand$trumpvote[629] <- 10
    roomdata_rand$county[630] <- "Victoria_TX"
    roomdata_rand$trumpvote[630] <- 68.5
    roomdata_rand$county[631] <- "Yamhill_OR"
    roomdata_rand$trumpvote[631] <- 50.1
    roomdata_rand$county[632] <- "Honolulu_HI"
    roomdata_rand$trumpvote[632] <- 31.7
    roomdata_rand$county[633] <- "Worcester_MA"
    roomdata_rand$trumpvote[633] <- 41.2
    roomdata_rand$county[634] <- "Washington_DC"
    roomdata_rand$trumpvote[634] <- 4
    roomdata_rand$county[635] <- "Guilford_NC"
    roomdata_rand$trumpvote[635] <- 38.7
    roomdata_rand$county[636] <- "Waukesha_WI"
    roomdata_rand$trumpvote[636] <- 61.6
    roomdata_rand$county[637] <- "Gregg_TX"
    roomdata_rand$trumpvote[637] <- 69.4
    roomdata_rand$county[638] <- "Washington_DC"
    roomdata_rand$trumpvote[638] <- 4
    roomdata_rand$county[639] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[639] <- 23.4
    roomdata_rand$county[640] <- "MissoulaCounty_MT"
    roomdata_rand$trumpvote[640] <- 38
    roomdata_rand$county[641] <- "Franklin_VA"
    roomdata_rand$trumpvote[641] <- 69.2
    roomdata_rand$county[642] <- "Dawes_NE"
    roomdata_rand$trumpvote[642] <- 71.5
    roomdata_rand$county[643] <- "Miami-Dade_FL"
    roomdata_rand$trumpvote[643] <- 34.1
    roomdata_rand$county[644] <- "Adams_NE"
    roomdata_rand$trumpvote[644] <- 69.9
    roomdata_rand$county[645] <- "Tangipahoa_LA"
    roomdata_rand$trumpvote[645] <- 64.8
    roomdata_rand$county[646] <- "Chester_PA"
    roomdata_rand$trumpvote[646] <- 43.3
    roomdata_rand$county[647] <- "Orange_NC"
    roomdata_rand$trumpvote[647] <- 23
    roomdata_rand$county[648] <- "Fayette_KY"
    roomdata_rand$trumpvote[648] <- 41.8
    roomdata_rand$county[649] <- "Albany_NY"
    roomdata_rand$trumpvote[649] <- 35.2
    roomdata_rand$county[650] <- "Alaska"
    roomdata_rand$trumpvote[650] <- 51.28
    roomdata_rand$county[651] <- "Delaware_PA"
    roomdata_rand$trumpvote[651] <- 37.4
    roomdata_rand$county[652] <- "Suffolk_MA"
    roomdata_rand$trumpvote[652] <- 16.5
    roomdata_rand$county[653] <- "Chester_PA"
    roomdata_rand$trumpvote[653] <- 43.3
    roomdata_rand$county[654] <- "Hardin_OH"
    roomdata_rand$trumpvote[654] <- 71.1
    roomdata_rand$county[655] <- "Multnomah_OR"
    roomdata_rand$trumpvote[655] <- 17.6
    roomdata_rand$county[656] <- "Palm Beach_FL"
    roomdata_rand$trumpvote[656] <- 41.2
    roomdata_rand$county[657] <- "Jackson_FL"
    roomdata_rand$trumpvote[657] <- 67.8
    roomdata_rand$county[658] <- "Woodbury_IA"
    roomdata_rand$trumpvote[658] <- 57.4
    roomdata_rand$county[659] <- "Franklin_KS"
    roomdata_rand$trumpvote[659] <- 65.9
    roomdata_rand$county[660] <- "Harrison_TX"
    roomdata_rand$trumpvote[660] <- 71
    roomdata_rand$county[661] <- "Bernalillo_NM"
    roomdata_rand$trumpvote[661] <- 34.5
    roomdata_rand$county[662] <- "Shelby_TN"
    roomdata_rand$trumpvote[662] <- 34.6
    roomdata_rand$county[663] <- "Lebanon_PA"
    roomdata_rand$trumpvote[663] <- 65.9
    roomdata_rand$county[664] <- "Knox_OH"
    roomdata_rand$trumpvote[664] <- 66.9
    roomdata_rand$county[665] <- "Troup_GA"
    roomdata_rand$trumpvote[665] <- 60.6
    roomdata_rand$county[666] <- "Wayne_NC"
    roomdata_rand$trumpvote[666] <- 54.9
    roomdata_rand$county[667] <- "St. Johns_FL"
    roomdata_rand$trumpvote[667] <- 65
    roomdata_rand$county[668] <- "Essex_MA"
    roomdata_rand$trumpvote[668] <- 36
    roomdata_rand$county[669] <- "Davison_SD"
    roomdata_rand$trumpvote[669] <- 64.9
    roomdata_rand$county[670] <- "Suffolk_MA"
    roomdata_rand$trumpvote[670] <- 16.5
    roomdata_rand$county[671] <- "Mecklenburg_NC"
    roomdata_rand$trumpvote[671] <- 33.4
    roomdata_rand$county[672] <- "Berkshire_MA"
    roomdata_rand$trumpvote[672] <- 26
    roomdata_rand$county[673] <- "Hunt_TX"
    roomdata_rand$trumpvote[673] <- 76.5
    roomdata_rand$county[674] <- "Decatur_IA"
    roomdata_rand$trumpvote[674] <- 62
    roomdata_rand$county[675] <- "Floyd_GA"
    roomdata_rand$trumpvote[675] <- 70.2
    roomdata_rand$county[676] <- "Multnomah_OR"
    roomdata_rand$trumpvote[676] <- 17.6
    roomdata_rand$county[677] <- "Hillsdale_MI"
    roomdata_rand$trumpvote[677] <- 70.9
    roomdata_rand$county[678] <- "Hudson_NJ"
    roomdata_rand$trumpvote[678] <- 22.6
    roomdata_rand$county[679] <- "Calhoun_AL"
    roomdata_rand$trumpvote[679] <- 69.2
    roomdata_rand$county[680] <- "Orangeburg_SC"
    roomdata_rand$trumpvote[680] <- 30.7
    roomdata_rand$county[681] <- "Lackawanna_PA"
    roomdata_rand$trumpvote[681] <- 46.8
    roomdata_rand$county[682] <- "Gloucester_NJ"
    roomdata_rand$trumpvote[682] <- 48.4
    roomdata_rand$county[683] <- "Amherst_VA"
    roomdata_rand$trumpvote[683] <- 63.6
    roomdata_rand$county[684] <- "Orange_FL"
    roomdata_rand$trumpvote[684] <- 35.7
    roomdata_rand$county[685] <- "Montgomery_PA"
    roomdata_rand$trumpvote[685] <- 37.6
    roomdata_rand$county[686] <- "DeKalb_GA"
    roomdata_rand$trumpvote[686] <- 16.1
    roomdata_rand$county[687] <- "San_Diego_CA"
    roomdata_rand$trumpvote[687] <- 38.2
    roomdata_rand$county[688] <- "Volusia_FL"
    roomdata_rand$trumpvote[688] <- 54.8
    roomdata_rand$county[689] <- "Allegheny_PA"
    roomdata_rand$trumpvote[689] <- 40
    roomdata_rand$county[690] <- "Florence_SC"
    roomdata_rand$trumpvote[690] <- 51.1
    roomdata_rand$county[691] <- "Marion_KS"
    roomdata_rand$trumpvote[691] <- 71.9
    roomdata_rand$county[692] <- "Suffolk_MA"
    roomdata_rand$trumpvote[692] <- 16.5
    roomdata_rand$county[693] <- "Lake_IL"
    roomdata_rand$trumpvote[693] <- 37
    roomdata_rand$county[694] <- "Washington_OR"
    roomdata_rand$trumpvote[694] <- 32.7
    roomdata_rand$county[695] <- "Brown_TX"
    roomdata_rand$trumpvote[695] <- 86.1
    roomdata_rand$county[696] <- "QueensCounty_NY"
    roomdata_rand$trumpvote[696] <- 22
    roomdata_rand$county[697] <- "Norfolk_MA"
    roomdata_rand$trumpvote[697] <- 33.3
    roomdata_rand$county[698] <- "Norfolk_MA"
    roomdata_rand$trumpvote[698] <- 33.3
    roomdata_rand$county[699] <- "Butte_CA"
    roomdata_rand$trumpvote[699] <- 48
    
    roomdata_rand$county[700] <- "Bryan_OK"
    roomdata_rand$trumpvote[700] <- 75.9
    roomdata_rand$county[701] <- "Outagamie_WI"
    roomdata_rand$trumpvote[701] <- 54.2
    roomdata_rand$county[702] <- "Hidalgo_TX"
    roomdata_rand$trumpvote[702] <- 28.1
    roomdata_rand$county[703] <- "King_WA"
    roomdata_rand$trumpvote[703] <- 21.7
    roomdata_rand$county[704] <- "Tompkins_NY"
    roomdata_rand$trumpvote[704] <- 25.6
    roomdata_rand$county[705] <- "CookCounty_IL"
    roomdata_rand$trumpvote[705] <- 21.4
    roomdata_rand$county[706] <- "Catawba_NC"
    roomdata_rand$trumpvote[706] <- 67.6
    roomdata_rand$county[707] <- "Wayne_MI"
    roomdata_rand$trumpvote[707] <- 29.5
    roomdata_rand$county[708] <- "Delaware_PA"
    roomdata_rand$trumpvote[708] <- 37.4
    roomdata_rand$county[709] <- "RichmondCounty_NY"
    roomdata_rand$trumpvote[709] <- 57
    roomdata_rand$county[710] <- "Brazos_TX"
    roomdata_rand$trumpvote[710] <- 58.5
    roomdata_rand$county[711] <- "Jefferson_IA"
    roomdata_rand$trumpvote[711] <- 46.7
    roomdata_rand$county[712] <- "New Castle_DE"
    roomdata_rand$trumpvote[712] <- 32.7
    roomdata_rand$county[713] <- "Randall_TX"
    roomdata_rand$trumpvote[713] <- 80.6
    roomdata_rand$county[714] <- "Dutchess_NY"
    roomdata_rand$trumpvote[714] <- 48.4
    roomdata_rand$county[715] <- "Jefferson_WV"
    roomdata_rand$trumpvote[715] <- 54.8
    roomdata_rand$county[716] <- "Montgomery_IN"
    roomdata_rand$trumpvote[716] <- 73.2
    roomdata_rand$county[717] <- "Coles_IL"
    roomdata_rand$trumpvote[717] <- 60.2
    roomdata_rand$county[718] <- "Mobile_AL"
    roomdata_rand$trumpvote[718] <- 55.7
    roomdata_rand$county[719] <- "Cuyahoga_OH"
    roomdata_rand$trumpvote[719] <- 30.8
    roomdata_rand$county[720] <- "Abbeville_SC"
    roomdata_rand$trumpvote[720] <- 62.9
    roomdata_rand$county[721] <- "KingsCounty_NY"
    roomdata_rand$trumpvote[721] <- 17.9
    roomdata_rand$county[722] <- "Morgan_IL"
    roomdata_rand$trumpvote[722] <- 62
    roomdata_rand$county[723] <- "SanDiego_CA"
    roomdata_rand$trumpvote[723] <- 38.7
    roomdata_rand$county[724] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[724] <- 23.4
    roomdata_rand$county[725] <- "San Miguel_NM"
    roomdata_rand$trumpvote[725] <- 21.5
    roomdata_rand$county[726] <- "Tuscaloosa_AL"
    roomdata_rand$trumpvote[726] <- 58.4
    roomdata_rand$county[727] <- "Nemaha_NE"
    roomdata_rand$trumpvote[727] <- 68.1
    roomdata_rand$county[728] <- "Harris_TX"
    roomdata_rand$trumpvote[728] <- 41.8
    roomdata_rand$county[729] <- "Hartford_CT"
    roomdata_rand$trumpvote[729] <- 37.1
    roomdata_rand$county[730] <- "Rockingham_VA"
    roomdata_rand$trumpvote[730] <- 69.2
    roomdata_rand$county[731] <- "Cleveland_OK"
    roomdata_rand$trumpvote[731] <- 57.1
    roomdata_rand$county[732] <- "Kent_MI"
    roomdata_rand$trumpvote[732] <- 48.3
    roomdata_rand$county[733] <- "Rutland_VT"
    roomdata_rand$trumpvote[733] <- 45.1
    roomdata_rand$county[734] <- "Mercer_NJ"
    roomdata_rand$trumpvote[734] <- 30.1
    roomdata_rand$county[735] <- "Newport News_VA"
    roomdata_rand$trumpvote[735] <- 34.6
    roomdata_rand$county[736] <- "Pickens_SC"
    roomdata_rand$trumpvote[736] <- 73.9
    roomdata_rand$county[737] <- "ContraCosta_CA"
    roomdata_rand$trumpvote[737] <- 26.1
    roomdata_rand$county[738] <- "Henry_IA"
    roomdata_rand$trumpvote[738] <- 62.1
    roomdata_rand$county[739] <- "King_WA"
    roomdata_rand$trumpvote[739] <- 21.4
    roomdata_rand$county[740] <- "Floyd_IN"
    roomdata_rand$trumpvote[740] <- 57.6
    roomdata_rand$county[741] <- "Jackson_MI"
    roomdata_rand$trumpvote[741] <- 57.2
    roomdata_rand$county[742] <- "Lehigh_PA"
    roomdata_rand$trumpvote[742] <- 45.9
    roomdata_rand$county[743] <- "KingsCounty_NY" 
    roomdata_rand$trumpvote[743] <- 17.9
    roomdata_rand$county[744] <- "Okaloosa_FL"
    roomdata_rand$trumpvote[744] <- 71.3
    roomdata_rand$county[745] <- "Maricopa_AZ" 
    roomdata_rand$trumpvote[745] <- 49.1
    roomdata_rand$county[746] <- "Ventura_CA"
    roomdata_rand$trumpvote[746] <- 39.2
    roomdata_rand$county[747] <- "Rock Island_IL"
    roomdata_rand$trumpvote[747] <- 42.8
    roomdata_rand$county[748] <- "Miami-Dade_FL"
    roomdata_rand$trumpvote[748] <- 34.1
    roomdata_rand$county[749] <- "Leflore_MS"
    roomdata_rand$trumpvote[749] <- 28.8
    roomdata_rand$county[750] <- "McLean_IL"
    roomdata_rand$trumpvote[750] <- 46.9
    roomdata_rand$county[751] <- "San_Diego_CA"
    roomdata_rand$trumpvote[751] <- 38.2
    roomdata_rand$county[752] <- "Vanderburgh_IN"
    roomdata_rand$trumpvote[752] <- 56.2
    roomdata_rand$county[753] <- "LosAngelesCounty_CA"
    roomdata_rand$trumpvote[753] <- 23.4
    roomdata_rand$county[754] <- "Saline_NE"
    roomdata_rand$trumpvote[754] <- 59.4
    roomdata_rand$county[755] <- "Jefferson_AL"
    roomdata_rand$trumpvote[755] <- 45
    roomdata_rand$county[756] <- "Mercer_NJ"
    roomdata_rand$trumpvote[756] <- 30.1
    roomdata_rand$county[757] <- "Hampden_MA"
    roomdata_rand$trumpvote[757] <- 39.1
    roomdata_rand$county[758] <- "Clay_SD"
    roomdata_rand$trumpvote[758] <- 41.6
    roomdata_rand$county[759] <- "Providence_RI"
    roomdata_rand$trumpvote[759] <- 37.3
    roomdata_rand$county[760] <- "Polk_MN"
    roomdata_rand$trumpvote[760] <- 61.1
    roomdata_rand$county[761] <- "Yolo_CA"
    roomdata_rand$trumpvote[761] <- 26
    roomdata_rand$county[762] <- "Monroe_NY"
    roomdata_rand$trumpvote[762] <- 40.3
    roomdata_rand$county[763] <- "Leon_FL"
    roomdata_rand$trumpvote[763] <- 35.3
    roomdata_rand$county[764] <- "Traill_ND"
    roomdata_rand$trumpvote[764] <- 58.6
    roomdata_rand$county[765] <- "NewYorkCounty_NY"
    roomdata_rand$trumpvote[765] <- 10
    roomdata_rand$county[766] <- "Escambia_FL"
    roomdata_rand$trumpvote[766] <- 58.3
    roomdata_rand$county[767] <- "Lyon_KS"
    roomdata_rand$trumpvote[767] <- 54.1
    roomdata_rand$county[768] <- "Bell_TX"
    roomdata_rand$trumpvote[768] <- 55.1
    roomdata_rand$county[769] <- "Ward_ND"
    roomdata_rand$trumpvote[769] <- 69.2
    roomdata_rand$county[770] <- "Socorro_NM"
    roomdata_rand$trumpvote[770] <- 38.2
    roomdata_rand$county[771] <- "ShawneeCounty_KA"
    roomdata_rand$trumpvote[771] <- 48
    roomdata_rand$county[772] <- "Jefferson_KY"
    roomdata_rand$trumpvote[772] <- 41.7
    roomdata_rand$county[773] <- "SanMateo_CA"
    roomdata_rand$trumpvote[773] <- 19.1
    roomdata_rand$county[774] <- "MilwaukeeCounty_WI"
    roomdata_rand$trumpvote[774] <- 29
    roomdata_rand$county[775] <- "Nash_NC"
    roomdata_rand$trumpvote[775] <- 49.3
    roomdata_rand$county[776] <- "Lancaster_PA"
    roomdata_rand$trumpvote[776] <- 57.3
    roomdata_rand$county[777] <- "San_Diego_CA"
    roomdata_rand$trumpvote[777] <- 38.2
    roomdata_rand$county[778] <- "Newport_RI"
    roomdata_rand$trumpvote[778] <- 37.6
    roomdata_rand$county[779] <- "Horry_SC"
    roomdata_rand$trumpvote[779] <- 67.3
    roomdata_rand$county[780] <- "Wood_WV"
    roomdata_rand$trumpvote[780] <- 71.4
    roomdata_rand$county[781] <- "Wyoming_PA"
    roomdata_rand$trumpvote[781] <- 67.4
    roomdata_rand$county[782] <- "Yamhill_OR"
    roomdata_rand$trumpvote[782] <- 50.1
    roomdata_rand$county[783] <- "Hinds_MS"
    roomdata_rand$trumpvote[783] <- 27.2
    roomdata_rand$county[784] <- "Greene_AR"
    roomdata_rand$trumpvote[784] <- 73.5
    roomdata_rand$county[785] <- "San_Diego_CA"
    roomdata_rand$trumpvote[785] <- 38.2
    roomdata_rand$county[786] <- "Multnomah_OR"
    roomdata_rand$trumpvote[786] <- 17.6
    roomdata_rand$county[787] <- "Cook_IL"
    roomdata_rand$trumpvote[787] <- 21.4
    roomdata_rand$county[788] <- "Washington_RI"
    roomdata_rand$trumpvote[788] <- 42.1
    roomdata_rand$county[789] <- "TarrantCounty_TX"
    roomdata_rand$trumpvote[789] <- 52
    roomdata_rand$county[790] <- "Washington_PA"
    roomdata_rand$trumpvote[790] <- 60.8
    roomdata_rand$county[791] <- "Fayette_IA"
    roomdata_rand$trumpvote[791] <- 57
    roomdata_rand$county[792] <- "Oneida_NY"
    roomdata_rand$trumpvote[792] <- 57.8
    roomdata_rand$county[793] <- "Berks_PA"
    roomdata_rand$trumpvote[793] <- 52.9
    roomdata_rand$county[794] <- "Cuyahoga_OH"
    roomdata_rand$trumpvote[794] <- 30.8
    roomdata_rand$county[795] <- "Caddo_LA"
    roomdata_rand$trumpvote[795] <- 46.3
    roomdata_rand$county[796] <- "Norfolk City_VA"
    roomdata_rand$trumpvote[796] <- 26.4
    roomdata_rand$county[797] <- "OrleansParish_LA"
    roomdata_rand$trumpvote[797] <- 14.7
    roomdata_rand$county[798] <- "SaratogaCounty_NY" 
    roomdata_rand$trumpvote[798] <- 49.1
    roomdata_rand$county[799] <- "QueensCounty_NY"
    roomdata_rand$trumpvote[799] <- 22
    
    roomdata_rand$county[800] <- "Alaska"
    roomdata_rand$trumpvote[800] <- 51.28
    roomdata_rand$county[801] <- "BaltimoreCounty_MD"
    roomdata_rand$trumpvote[801] <- 39.1
    roomdata_rand$county[802] <- "Linn_IA"
    roomdata_rand$trumpvote[802] <- 42
    roomdata_rand$county[803] <- "CookCounty_IL"
    roomdata_rand$trumpvote[803] <- 21.4
    roomdata_rand$county[804] <- "York_ME"
    roomdata_rand$trumpvote[804] <- 44.2
    roomdata_rand$county[805] <- "Spartanburg_SC"
    roomdata_rand$trumpvote[805] <- 63
    roomdata_rand$county[806] <- "Alcorn_MS"
    roomdata_rand$trumpvote[806] <- 80.1
    roomdata_rand$county[807] <- "Taney_MO"
    roomdata_rand$trumpvote[807] <- 78
    roomdata_rand$county[808] <- "Mesa_CO"
    roomdata_rand$trumpvote[808] <- 64.3
    roomdata_rand$county[809] <- "Will_IL"
    roomdata_rand$trumpvote[809] <- 44.6
    roomdata_rand$county[810] <- "Fulton_GA"
    roomdata_rand$trumpvote[810] <- 27.1
    roomdata_rand$county[811] <- "Morris_NJ"
    roomdata_rand$trumpvote[811] <- 50.4
    roomdata_rand$county[812] <- "Bay_MI"
    roomdata_rand$trumpvote[812] <- 53.5
    roomdata_rand$county[813] <- "Harvey_KS"
    roomdata_rand$trumpvote[813] <- 58.5
    roomdata_rand$county[814] <- "Summit_OH"
    roomdata_rand$trumpvote[814] <- 43.8
    roomdata_rand$county[815] <- "Baltimore City_MD"
    roomdata_rand$trumpvote[815] <- 10.9
    roomdata_rand$county[816] <- "Merced_CA"
    roomdata_rand$trumpvote[816] <- 43.5
    roomdata_rand$county[817] <- "Webb_TX"
    roomdata_rand$trumpvote[817] <- 22.8
    roomdata_rand$county[818] <- "Hampshire_MA"
    roomdata_rand$trumpvote[818] <- 26.8
    roomdata_rand$county[819] <- "Stark_OH"
    roomdata_rand$trumpvote[819] <- 56.4
    roomdata_rand$county[820] <- "Nueces_TX"
    roomdata_rand$trumpvote[820] <- 48.8
    roomdata_rand$county[821] <- "Suffolk_NY"
    roomdata_rand$trumpvote[821] <- 52.5
    roomdata_rand$county[822] <- "Montgomery_TN"
    roomdata_rand$trumpvote[822] <- 56.4
    roomdata_rand$county[823] <- "Clarion_PA"
    roomdata_rand$trumpvote[823] <- 71.8
    roomdata_rand$county[824] <- "BronxCounty_NY"
    roomdata_rand$trumpvote[824] <- 9.6
    roomdata_rand$county[825] <- "KingCounty_WA"
    roomdata_rand$trumpvote[825] <- 22
    roomdata_rand$county[826] <- "Dallas_TX"
    roomdata_rand$trumpvote[826] <- 34.9
    roomdata_rand$county[827] <- "Denton_TX"
    roomdata_rand$trumpvote[827] <- 57.7
    roomdata_rand$county[828] <- "Adair_MO"
    roomdata_rand$trumpvote[828] <- 59.4
    roomdata_rand$county[829] <- "Berks_PA"
    roomdata_rand$trumpvote[829] <- 52.9
    roomdata_rand$county[830] <- "Pierce_WA"
    roomdata_rand$trumpvote[830] <- 42.3
    roomdata_rand$county[831] <- "Perry_AL"
    roomdata_rand$trumpvote[831] <- 26.7
    roomdata_rand$county[832] <- "CaddoParish_LA"
    roomdata_rand$trumpvote[832] <- 46.3
    roomdata_rand$county[833] <- "Washington_DC"
    roomdata_rand$trumpvote[833] <- 4.1
    roomdata_rand$county[834] <- "Custer_OK"
    roomdata_rand$trumpvote[834] <- 74.2
    roomdata_rand$county[835] <- "Morris_NJ"
    roomdata_rand$trumpvote[835] <- 50.4
    roomdata_rand$county[836] <- "Marion_IN"
    roomdata_rand$trumpvote[836] <- 36.2
    roomdata_rand$county[837] <- "Sedgwick_KS"
    roomdata_rand$trumpvote[837] <- 56.1
    roomdata_rand$county[838] <- "Nassau_NY"
    roomdata_rand$trumpvote[838] <- 45.9
    roomdata_rand$county[839] <- "Dallas_TX"
    roomdata_rand$trumpvote[839] <- 34.9
    roomdata_rand$county[840] <- "RamseyCounty_MN"
    roomdata_rand$trumpvote[840] <- 26.3
    roomdata_rand$county[841] <- "Lumpkin_GA"
    roomdata_rand$trumpvote[841] <- 78
    roomdata_rand$county[842] <- "Mercer_PA"
    roomdata_rand$trumpvote[842] <- 60.6
    roomdata_rand$county[843] <- "Bradley_TN"
    roomdata_rand$trumpvote[843] <- 77.5
    roomdata_rand$county[844] <- "Hartford_CT"
    roomdata_rand$trumpvote[844] <- 37.1
    roomdata_rand$county[845] <- "Warren_IA"
    roomdata_rand$trumpvote[845] <- 54.9
    roomdata_rand$county[846] <- "Platte_MO"
    roomdata_rand$trumpvote[846] <- 53.5
    roomdata_rand$county[847] <- "BronxCounty_NY"
    roomdata_rand$trumpvote[847] <- 9.6
    roomdata_rand$county[848] <- "San Bernardino_CA"
    roomdata_rand$trumpvote[848] <- 42.4
    roomdata_rand$county[849] <- "BaltimoreCounty_MD"
    roomdata_rand$trumpvote[849] <- 39.1
    roomdata_rand$county[850] <- "McPherson_KS"
    roomdata_rand$trumpvote[850] <- 67.6
    roomdata_rand$county[851] <- "Marion_MO"
    roomdata_rand$trumpvote[851] <- 73
    roomdata_rand$county[852] <- "Robeson_NC"
    roomdata_rand$trumpvote[852] <- 51.4
    roomdata_rand$county[853] <- "Clinton_OH"
    roomdata_rand$trumpvote[853] <- 74.4
    roomdata_rand$county[854] <- "Santa Cruz_CA"
    roomdata_rand$trumpvote[854] <- 17.8
    roomdata_rand$county[855] <- "SanFranciscoCounty_CA"
    roomdata_rand$trumpvote[855] <- 9.9
    roomdata_rand$county[856] <- "CookCounty_IL"
    roomdata_rand$trumpvote[856] <- 21.4
    roomdata_rand$county[857] <- "New York_NY"
    roomdata_rand$trumpvote[857] <- 10
    roomdata_rand$county[858] <- "Onondaga_NY"
    roomdata_rand$trumpvote[858] <- 40.8
    roomdata_rand$county[859] <- "BronxCounty_NY"
    roomdata_rand$trumpvote[859] <- 9.6
    roomdata_rand$county[860] <- "Morgan_IL"
    roomdata_rand$trumpvote[860] <- 62
    roomdata_rand$county[861] <- "Washington_VT"
    roomdata_rand$trumpvote[861] <- 27.9
    roomdata_rand$county[862] <- "Madison_NY"
    roomdata_rand$trumpvote[862] <- 54.4
    roomdata_rand$county[863] <- "KingsCounty_NY"
    roomdata_rand$trumpvote[863] <- 17.9
    roomdata_rand$county[864] <- "Craighead_AR"
    roomdata_rand$trumpvote[864] <- 64.4
    roomdata_rand$county[865] <- "Los Angeles_CA" 
    roomdata_rand$trumpvote[865] <- 23.4
    roomdata_rand$county[866] <- "Douglas_KS"
    roomdata_rand$trumpvote[866] <- 29.7
    roomdata_rand$county[867] <- "Clay_FL"
    roomdata_rand$trumpvote[867] <- 70.4
    roomdata_rand$county[868] <- "El Paso_TX"
    roomdata_rand$trumpvote[868] <- 25.9
    roomdata_rand$county[869] <- "Lee_FL"
    roomdata_rand$trumpvote[869] <- 58.7
    roomdata_rand$county[870] <- "Nez Perce_ID"
    roomdata_rand$trumpvote[870] <- 62.2
    roomdata_rand$county[871] <- "MontgomeryCounty_AL"
    roomdata_rand$trumpvote[871] <- 35.9
    roomdata_rand$county[872] <- "Shelby_AL"
    roomdata_rand$trumpvote[872] <- 73.4
    roomdata_rand$county[873] <- "Roanoke_VA"
    roomdata_rand$trumpvote[873] <- 61.5
    roomdata_rand$county[874] <- "Adams_PA"
    roomdata_rand$trumpvote[874] <- 66.3
    roomdata_rand$county[875] <- "Elkhart_IN"
    roomdata_rand$trumpvote[875] <- 64.1
    roomdata_rand$county[876] <- "Franklin_IN"
    roomdata_rand$trumpvote[876] <- 78.8
    roomdata_rand$county[877] <- "MontgomeryCounty_AL"
    roomdata_rand$trumpvote[877] <- 35.9
    roomdata_rand$county[878] <- "Dane_WI"
    roomdata_rand$trumpvote[878] <- 23.4
    roomdata_rand$county[879] <- "Orange_NY"
    roomdata_rand$trumpvote[879] <- 51.2
    roomdata_rand$county[880] <- "Kalamazoo_MI"
    roomdata_rand$trumpvote[880] <- 40.5
    roomdata_rand$county[881] <- "Taylor_TX"
    roomdata_rand$trumpvote[881] <- 73.3
    roomdata_rand$county[882] <- "Blount_TN"
    roomdata_rand$trumpvote[882] <- 72.1
    roomdata_rand$county[883] <- "Wabash_IN"
    roomdata_rand$trumpvote[883] <- 73.2
    roomdata_rand$county[884] <- "Harrison_TX"
    roomdata_rand$trumpvote[884] <- 71
    roomdata_rand$county[885] <- "Oklahoma_OK"
    roomdata_rand$trumpvote[885] <- 51.7
    roomdata_rand$county[886] <- "Cook_IL"
    roomdata_rand$trumpvote[886] <- 21.4
    roomdata_rand$county[887] <- "Chippewa_MI"
    roomdata_rand$trumpvote[887] <- 59.1
    roomdata_rand$county[888] <- "BronxCounty_NY"
    roomdata_rand$trumpvote[888] <- 9.6
    roomdata_rand$county[889] <- "Alameda_CA"
    roomdata_rand$trumpvote[889] <- 14.9
    roomdata_rand$county[890] <- "Kent_MI"
    roomdata_rand$trumpvote[890] <- 48.3
    roomdata_rand$county[891] <- "Cheshire_NH"
    roomdata_rand$trumpvote[891] <- 41
    roomdata_rand$county[892] <- "Bristol_MA"
    roomdata_rand$trumpvote[892] <- 42.6
    roomdata_rand$county[893] <- "SanDiego_CA"
    roomdata_rand$trumpvote[893] <- 38.7
    roomdata_rand$county[894] <- "Kenton_KY"
    roomdata_rand$trumpvote[894] <- 59.7
    roomdata_rand$county[895] <- "Fairfield_CT"
    roomdata_rand$trumpvote[895] <- 37.9
    roomdata_rand$county[896] <- "Hamilton_OH"
    roomdata_rand$trumpvote[896] <- 43
    roomdata_rand$county[897] <- "Lancaster_NE"
    roomdata_rand$trumpvote[897] <- 46.6
    roomdata_rand$county[898] <- "Whitley_KY"
    roomdata_rand$trumpvote[898] <- 82.2
    roomdata_rand$county[899] <- "Greenville_SC"
    roomdata_rand$trumpvote[899] <- 59.4
    
    roomdata_rand$county[900] <- "Atlantic_NJ"
    roomdata_rand$trumpvote[900] <- 45.3
    roomdata_rand$county[901] <- "Walker_GA"
    roomdata_rand$trumpvote[901] <- 79.1
    roomdata_rand$county[902] <- "Hamilton_OH"
    roomdata_rand$trumpvote[902] <- 43
    roomdata_rand$county[903] <- "Lake_IN"
    roomdata_rand$trumpvote[903] <- 37.7
    roomdata_rand$county[904] <- "Wake_NC"
    roomdata_rand$trumpvote[904] <- 37.9
    roomdata_rand$county[905] <- "Hanover_VA"
    roomdata_rand$trumpvote[905] <- 63.5
    roomdata_rand$county[906] <- "Lee_AL"
    roomdata_rand$trumpvote[906] <- 59.5
    roomdata_rand$county[907] <- "Essex_NJ"
    roomdata_rand$trumpvote[907] <- 20.7
    roomdata_rand$county[908] <- "Mercer_NJ"
    roomdata_rand$trumpvote[908] <- 30.1
    roomdata_rand$county[909] <- "Dane_WI"
    roomdata_rand$trumpvote[909] <- 23.4
    roomdata_rand$county[910] <- "New York_NY"
    roomdata_rand$trumpvote[910] <- 10
    roomdata_rand$county[911] <- "Dubuque_IA"
    roomdata_rand$trumpvote[911] <- 47.7
    roomdata_rand$county[912] <- "Sacramento_CA"
    roomdata_rand$trumpvote[912] <- 34.9
    roomdata_rand$county[913] <- "Madison_NY"
    roomdata_rand$trumpvote[913] <- 54.4
    roomdata_rand$county[914] <- "Anderson_SC"
    roomdata_rand$trumpvote[914] <- 69.9
    roomdata_rand$county[915] <- "Marshall_MS"
    roomdata_rand$trumpvote[915] <- 44.4
    roomdata_rand$county[916] <- "Brown_SD"
    roomdata_rand$trumpvote[916] <- 59.7
    roomdata_rand$county[917] <- "Franklin_WA"
    roomdata_rand$trumpvote[917] <- 55.2
    roomdata_rand$county[918] <- "Fulton_GA"
    roomdata_rand$trumpvote[918] <- 27.1
    roomdata_rand$county[919] <- "Bronx_NY"
    roomdata_rand$trumpvote[919] <- 9.6
    roomdata_rand$county[920] <- "St. Louis_MO"
    roomdata_rand$trumpvote[920] <- 39.5
    roomdata_rand$county[921] <- "Nicollet_MN"
    roomdata_rand$trumpvote[921] <- 47.1
    roomdata_rand$county[922] <- "Davidson_TN"
    roomdata_rand$trumpvote[922] <- 34.3
    roomdata_rand$county[923] <- "Champaign_OH"
    roomdata_rand$trumpvote[923] <- 70
    roomdata_rand$county[924] <- "Bexar_TX"
    roomdata_rand$trumpvote[924] <- 41
    roomdata_rand$county[925] <- "FresnoCounty_CA"
    roomdata_rand$trumpvote[925] <- 45.5
    roomdata_rand$county[926] <- "Dodge_NE"
    roomdata_rand$trumpvote[926] <- 65.1
    roomdata_rand$county[927] <- "Dupage_IL"
    roomdata_rand$trumpvote[927] <- 39.8
    roomdata_rand$county[928] <- "Kent_DE"
    roomdata_rand$trumpvote[928] <- 49.8
    roomdata_rand$county[929] <- "Poweshiek_IA"
    roomdata_rand$trumpvote[929] <- 50.9
    roomdata_rand$county[930] <- "Madison_TN"
    roomdata_rand$trumpvote[930] <- 56.5
    roomdata_rand$county[931] <- "Somerset_MD"
    roomdata_rand$trumpvote[931] <- 57.7
    roomdata_rand$county[932] <- "Santa Clara_CA"
    roomdata_rand$trumpvote[932] <- 20.9
    roomdata_rand$county[933] <- "Grayson_TX"
    roomdata_rand$trumpvote[933] <- 74.9
    roomdata_rand$county[934] <- "Salt Lake_UT"
    roomdata_rand$trumpvote[934] <- 32.6
    roomdata_rand$county[935] <- "Jefferson_CO"
    roomdata_rand$trumpvote[935] <- 42.1
    roomdata_rand$county[936] <- "Kent_MI"
    roomdata_rand$trumpvote[936] <- 48.3
    roomdata_rand$county[937] <- "Athens_OH"
    roomdata_rand$trumpvote[937] <- 38.7
    roomdata_rand$county[938] <- "Montgomery_PA"
    roomdata_rand$trumpvote[938] <- 37.6
    roomdata_rand$county[939] <- "Brookings_SD"
    roomdata_rand$trumpvote[939] <- 53.2
    roomdata_rand$county[940] <- "Ottawa_MI"
    roomdata_rand$trumpvote[940] <- 62.2
    roomdata_rand$county[941] <- "Sarasota_FL"
    roomdata_rand$trumpvote[941] <- 54.3
    roomdata_rand$county[942] <- "Chautauqua_NY"
    roomdata_rand$trumpvote[942] <- 59.6
    roomdata_rand$county[943] <- "Montgomery_MD" 
    roomdata_rand$trumpvote[943] <- 20.3
    roomdata_rand$county[944] <- "Emanuel_GA"
    roomdata_rand$trumpvote[944] <- 68
    roomdata_rand$county[945] <- "Santa Clara_CA"
    roomdata_rand$trumpvote[945] <- 20.9
    roomdata_rand$county[946] <- "Hartford_CT"
    roomdata_rand$trumpvote[946] <- 37.1
    roomdata_rand$county[947] <- "VirginiaBeachCity_VA"
    roomdata_rand$trumpvote[947] <- 49.1
    roomdata_rand$county[948] <- "Lafayette_MS"
    roomdata_rand$trumpvote[948] <- 55.4
    roomdata_rand$county[949] <- "Hartford_CT"
    roomdata_rand$trumpvote[949] <- 37.1
    roomdata_rand$county[950] <- "Marion_IN"
    roomdata_rand$trumpvote[950] <- 36.1
    roomdata_rand$county[951] <- "Clark_AR"
    roomdata_rand$trumpvote[951] <- 51.7
    roomdata_rand$county[952] <- "Arlington_VA"
    roomdata_rand$trumpvote[952] <- 16.9
    roomdata_rand$county[953] <- "Limestone_AL"
    roomdata_rand$trumpvote[953] <- 73.2
    roomdata_rand$county[954] <- "Fairfax_VA"
    roomdata_rand$trumpvote[954] <- 29.1
    roomdata_rand$county[955] <- "Champaign_IL"
    roomdata_rand$trumpvote[955] <- 37.3
    roomdata_rand$county[956] <- "Rowan_NC"
    roomdata_rand$trumpvote[956] <- 67.2
    roomdata_rand$county[957] <- "Luzerne_PA"
    roomdata_rand$trumpvote[957] <- 58.4
    roomdata_rand$county[958] <- "Middlesex_NJ"
    roomdata_rand$trumpvote[958] <- 38.6
    roomdata_rand$county[959] <- "Buffalo_NE"
    roomdata_rand$trumpvote[959] <- 70.4
    roomdata_rand$county[960] <- "Middlesex_MA"
    roomdata_rand$trumpvote[960] <- 28.2
    roomdata_rand$county[961] <- "Spokane_WA"
    roomdata_rand$trumpvote[961] <- 49.8
    roomdata_rand$county[962] <- "Laurens_SC"
    roomdata_rand$trumpvote[962] <- 63.3
    roomdata_rand$county[963] <- "Staunton City_VA"
    roomdata_rand$trumpvote[963] <- 46
    roomdata_rand$county[964] <- "Cattaraugus_NY"
    roomdata_rand$trumpvote[964] <- 64.5
    roomdata_rand$county[965] <- "Steuben_IN"
    roomdata_rand$trumpvote[965] <- 69.7
    roomdata_rand$county[966] <- "Westchester_NY"
    roomdata_rand$trumpvote[966] <- 32.1
    roomdata_rand$county[967] <- "Lackawanna_PA"
    roomdata_rand$trumpvote[967] <- 46.8
    roomdata_rand$county[968] <- "Harris_TX"
    roomdata_rand$trumpvote[968] <- 41.8
    roomdata_rand$county[969] <- "Albany_NY"
    roomdata_rand$trumpvote[969] <- 35.2
    roomdata_rand$county[970] <- "Brevard_FL"
    roomdata_rand$trumpvote[970] <- 57.8
    roomdata_rand$county[971] <- "Nacogdoches_TX"
    roomdata_rand$trumpvote[971] <- 65.8
    roomdata_rand$county[972] <- "CookCounty_IL"
    roomdata_rand$trumpvote[972] <- 21.4
    roomdata_rand$county[973] <- "Hillsborough_NH"
    roomdata_rand$trumpvote[973] <- 47.5
    roomdata_rand$county[974] <- "Essex_NJ"
    roomdata_rand$trumpvote[974] <- 20.7
    roomdata_rand$county[975] <- "Comanche_OK"
    roomdata_rand$trumpvote[975] <- 58.9
    roomdata_rand$county[976] <- "Jefferson_AL"
    roomdata_rand$trumpvote[976] <- 45
    roomdata_rand$county[977] <- "Washington_PA"
    roomdata_rand$trumpvote[977] <- 60.8
    roomdata_rand$county[978] <- "New York_NY"
    roomdata_rand$trumpvote[978] <- 10
    roomdata_rand$county[979] <- "Jefferson_IN"
    roomdata_rand$trumpvote[979] <- 63.4
    roomdata_rand$county[980] <- "MaricopaCounty_AZ"
    roomdata_rand$trumpvote[980] <- 49
    roomdata_rand$county[981] <- "Caledonia_VT"
    roomdata_rand$trumpvote[981] <- 42.7
    roomdata_rand$county[982] <- "Fredericksburg_VA"
    roomdata_rand$trumpvote[982] <- 33.5
    roomdata_rand$county[983] <- "Montgomery_OH"
    roomdata_rand$trumpvote[983] <- 48.4
    roomdata_rand$county[984] <- "Ocean_NJ"
    roomdata_rand$trumpvote[984] <- 65.5
    roomdata_rand$county[985] <- "CuyahogaCounty_OH"
    roomdata_rand$trumpvote[985] <- 30.8
    roomdata_rand$county[986] <- "Silver Bow_MT"
    roomdata_rand$trumpvote[986] <- 38.6
    roomdata_rand$county[987] <- "Sanpete_UT"
    roomdata_rand$trumpvote[987] <- 65.8
    roomdata_rand$county[988] <- "Tioga_PA"
    roomdata_rand$trumpvote[988] <- 74.6
    roomdata_rand$county[989] <- "Fond du Lac_WI"
    roomdata_rand$trumpvote[989] <- 60.8
    roomdata_rand$county[990] <- "Talladega_AL"
    roomdata_rand$trumpvote[990] <- 62
    roomdata_rand$county[991] <- "Newberry_SC"
    roomdata_rand$trumpvote[991] <- 59.6
    roomdata_rand$county[992] <- "Davidson_TN"
    roomdata_rand$trumpvote[992] <- 34.3
    roomdata_rand$county[993] <- "Logan_OK"
    roomdata_rand$trumpvote[993] <- 71.8
    roomdata_rand$county[994] <- "Jefferson_AL"
    roomdata_rand$trumpvote[994] <- 45
    roomdata_rand$county[995] <- "Wayne_IN"
    roomdata_rand$trumpvote[995] <- 62.7
    roomdata_rand$county[996] <- "Bolivar_MS"
    roomdata_rand$trumpvote[996] <- 33.1
    roomdata_rand$county[997] <- "Kent_MI"
    roomdata_rand$trumpvote[997] <- 48.3
    roomdata_rand$county[998] <- "Cascade_MT"
    roomdata_rand$trumpvote[998] <- 57
    roomdata_rand$county[999] <- "Canyon_ID"
    roomdata_rand$trumpvote[999] <- 65
    
    roomdata_rand$county[1000] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[1000] <- 23.4
    roomdata_rand$county[1001] <- "Hamilton_OH"
    roomdata_rand$trumpvote[1001] <- 43
    roomdata_rand$county[1002] <- "Allegany_NY"
    roomdata_rand$trumpvote[1002] <- 68.4
    roomdata_rand$county[1003] <- "Cayuga_NY"
    roomdata_rand$trumpvote[1003] <- 53.8
    roomdata_rand$county[1004] <- "Jackson_MO"
    roomdata_rand$trumpvote[1004] <- 39
    roomdata_rand$county[1005] <- "Buncombe_NC"
    roomdata_rand$trumpvote[1005] <- 41.1
    roomdata_rand$county[1006] <- "Kenosha_WI"
    roomdata_rand$trumpvote[1006] <- 47.5
    roomdata_rand$county[1007] <- "Columbia_AR"
    roomdata_rand$trumpvote[1007] <- 61.4
    roomdata_rand$county[1008] <- "NewHanoverCounty_NC"
    roomdata_rand$trumpvote[1008] <- 50.3
    roomdata_rand$county[1009] <- "Gratiot_MI"
    roomdata_rand$trumpvote[1009] <- 60.1
    roomdata_rand$county[1010] <- "Lycoming_PA"
    roomdata_rand$trumpvote[1010] <- 70.5
    roomdata_rand$county[1011] <- "Cache_UT"
    roomdata_rand$trumpvote[1011] <- 46.7
    roomdata_rand$county[1012] <- "Allen_IN"
    roomdata_rand$trumpvote[1012] <- 57.5
    roomdata_rand$county[1013] <- "Oktibbeha_MS"
    roomdata_rand$trumpvote[1013] <- 47.5
    roomdata_rand$county[1014] <- "Isabella_MI"
    roomdata_rand$trumpvote[1014] <- 48.7
    roomdata_rand$county[1015] <- "Washington_DC"
    roomdata_rand$trumpvote[1015] <- 4.1
    roomdata_rand$county[1016] <- "Mercer_WV"
    roomdata_rand$trumpvote[1016] <- 75.8
    roomdata_rand$county[1017] <- "Grand Traverse_MI"
    roomdata_rand$trumpvote[1017] <- 53.3
    roomdata_rand$county[1018] <- "Lee_FL"
    roomdata_rand$trumpvote[1018] <- 58.7
    roomdata_rand$county[1019] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[1019] <- 23.4
    roomdata_rand$county[1020] <- "Franklin_ME"
    roomdata_rand$trumpvote[1020] <- 48.2
    roomdata_rand$county[1021] <- "New Castle_DE"
    roomdata_rand$trumpvote[1021] <- 32.7
    roomdata_rand$county[1022] <- "Boone_MO"
    roomdata_rand$trumpvote[1022] <- 43.4
    roomdata_rand$county[1023] <- "CookCounty_IL"
    roomdata_rand$trumpvote[1023] <- 21.4
    roomdata_rand$county[1024] <- "Delaware_PA"
    roomdata_rand$trumpvote[1024] <- 37.4
    roomdata_rand$county[1025] <- "Porter_IN"
    roomdata_rand$trumpvote[1025] <- 50.6
    roomdata_rand$county[1026] <- "Bristol_MA"
    roomdata_rand$trumpvote[1026] <- 42.6
    roomdata_rand$county[1027] <- "Carter_KY"
    roomdata_rand$trumpvote[1027] <- 73.8
    roomdata_rand$county[1028] <- "Prince George's_MD"
    roomdata_rand$trumpvote[1028] <- 8.3
    roomdata_rand$county[1029] <- "Lewis_MO"
    roomdata_rand$trumpvote[1029] <- 75.1
    roomdata_rand$county[1030] <- "Marion_OR"
    roomdata_rand$trumpvote[1030] <- 49
    roomdata_rand$county[1031] <- "Whatcom_WA"
    roomdata_rand$trumpvote[1031] <- 37.2
    roomdata_rand$county[1032] <- "Harris_TX"
    roomdata_rand$trumpvote[1032] <- 41.8
    roomdata_rand$county[1033] <- "Greene_TN"
    roomdata_rand$trumpvote[1033] <- 78.9
    roomdata_rand$county[1034] <- "Winnebago_IL"
    roomdata_rand$trumpvote[1034] <- 47.7
    roomdata_rand$county[1035] <- "RapidesParish_LA"
    roomdata_rand$trumpvote[1035] <- 64.8
    roomdata_rand$county[1036] <- "Bucks_PA"
    roomdata_rand$trumpvote[1036] <- 47.8
    roomdata_rand$county[1037] <- "Linn_IA"
    roomdata_rand$trumpvote[1037] <- 42
    roomdata_rand$county[1038] <- "Portage_WI"
    roomdata_rand$trumpvote[1038] <- 45.4
    roomdata_rand$county[1039] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[1039] <- 23.4
    roomdata_rand$county[1040] <- "St. Lawrence_NY"
    roomdata_rand$trumpvote[1040] <- 52.5
    roomdata_rand$county[1041] <- "New York_NY"
    roomdata_rand$trumpvote[1041] <- 10
    roomdata_rand$county[1042] <- "Williamsburg City_VA"
    roomdata_rand$trumpvote[1042] <- 25.5
    roomdata_rand$county[1043] <- "Allen_OH"
    roomdata_rand$trumpvote[1043] <- 66.9
    roomdata_rand$county[1044] <- "Erie_NY"
    roomdata_rand$trumpvote[1044] <- 45.4
    roomdata_rand$county[1045] <- "Klamath_OR"
    roomdata_rand$trumpvote[1045] <- 69
    roomdata_rand$county[1046] <- "Cherokee_SC"
    roomdata_rand$trumpvote[1046] <- 69.7
    roomdata_rand$county[1047] <- "Richmond_GA"
    roomdata_rand$trumpvote[1047] <- 32.6
    roomdata_rand$county[1048] <- "HudsonCounty_NJ"
    roomdata_rand$trumpvote[1048] <- 22.6
    roomdata_rand$county[1049] <- "New York_NY"
    roomdata_rand$trumpvote[1049] <- 10
    roomdata_rand$county[1050] <- "HonoluluCounty_HI"
    roomdata_rand$trumpvote[1050] <- 32
    roomdata_rand$county[1051] <- "Seneca_OH"
    roomdata_rand$trumpvote[1051] <- 62
    roomdata_rand$county[1052] <- "Wichita_TX"
    roomdata_rand$trumpvote[1052] <- 72.8
    roomdata_rand$county[1053] <- "Barbour_WV"
    roomdata_rand$trumpvote[1053] <- 74.9
    roomdata_rand$county[1054] <- "Guilford_NC"
    roomdata_rand$trumpvote[1054] <- 38.7
    roomdata_rand$county[1055] <- "Iron_UT"
    roomdata_rand$trumpvote[1055] <- 65.3
    roomdata_rand$county[1056] <- "Wayne_MI"
    roomdata_rand$trumpvote[1056] <- 29.5
    roomdata_rand$county[1057] <- "Beltrami_MN"
    roomdata_rand$trumpvote[1057] <- 50.6
    roomdata_rand$county[1058] <- "Suffolk_MA"
    roomdata_rand$trumpvote[1058] <- 16.5
    roomdata_rand$county[1059] <- "Wilson_TN"
    roomdata_rand$trumpvote[1059] <- 69.8
    roomdata_rand$county[1060] <- "Mahaska_IA"
    roomdata_rand$trumpvote[1060] <- 70.6
    roomdata_rand$county[1061] <- "SanDiego_CA"
    roomdata_rand$trumpvote[1061] <- 38.7
    roomdata_rand$county[1062] <- "Hampden_MA"
    roomdata_rand$trumpvote[1062] <- 39.1
    roomdata_rand$county[1063] <- "Suffolk_MA"
    roomdata_rand$trumpvote[1063] <- 16.5
    roomdata_rand$county[1064] <- "Maricopa_AZ"
    roomdata_rand$trumpvote[1064] <- 49.1
    roomdata_rand$county[1065] <- "Brown_WI"
    roomdata_rand$trumpvote[1065] <- 52.7
    roomdata_rand$county[1066] <- "Cole_MO"
    roomdata_rand$trumpvote[1066] <- 66
    roomdata_rand$county[1067] <- "Bergen_NJ"
    roomdata_rand$trumpvote[1067] <- 42.5
    roomdata_rand$county[1068] <- "Norfolk_MA"
    roomdata_rand$trumpvote[1068] <- 33.3
    roomdata_rand$county[1069] <- "Tift_GA"
    roomdata_rand$trumpvote[1069] <- 67.8
    roomdata_rand$county[1070] <- "Barnes_ND"
    roomdata_rand$trumpvote[1070] <- 60.1
    roomdata_rand$county[1071] <- "Claiborne_TN"
    roomdata_rand$trumpvote[1071] <- 80.2
    roomdata_rand$county[1072] <- "Erie_PA"
    roomdata_rand$trumpvote[1072] <- 48.8
    roomdata_rand$county[1073] <- "Carter_TN"
    roomdata_rand$trumpvote[1073] <- 80.5
    roomdata_rand$county[1074] <- "Franklin_OH"
    roomdata_rand$trumpvote[1074] <- 34.7
    roomdata_rand$county[1075] <- "Westchester_NY"
    roomdata_rand$trumpvote[1075] <- 32.1
    roomdata_rand$county[1076] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[1076] <- 23.4
    roomdata_rand$county[1077] <- "Guadalupe_TX"
    roomdata_rand$trumpvote[1077] <- 63.8
    roomdata_rand$county[1078] <- "Lawrence_AR"
    roomdata_rand$trumpvote[1078] <- 71.5
    roomdata_rand$county[1079] <- "Anne Arundel_MD"
    roomdata_rand$trumpvote[1079] <- 47.1
    roomdata_rand$county[1080] <- "Eaton_MI"
    roomdata_rand$trumpvote[1080] <- 49.6
    roomdata_rand$county[1081] <- "Aroostook_ME"
    roomdata_rand$trumpvote[1081] <- 55.5
    roomdata_rand$county[1082] <- "Warren_NJ"
    roomdata_rand$trumpvote[1082] <- 60.7
    roomdata_rand$county[1083] <- "White_GA"
    roomdata_rand$trumpvote[1083] <- 82.8
    roomdata_rand$county[1084] <- "Montgomery_AL"
    roomdata_rand$trumpvote[1084] <- 35.9
    roomdata_rand$county[1085] <- "San Luis Obispo_CA"
    roomdata_rand$trumpvote[1085] <- 42.3
    roomdata_rand$county[1086] <- "Windham_CT"
    roomdata_rand$trumpvote[1086] <- 50.8
    roomdata_rand$county[1087] <- "New York_NY"
    roomdata_rand$trumpvote[1087] <- 10
    roomdata_rand$county[1088] <- "Johnson_KS"
    roomdata_rand$trumpvote[1088] <- 47.9
    roomdata_rand$county[1089] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[1089] <- 23.4
    roomdata_rand$county[1090] <- "Kane_IL"
    roomdata_rand$trumpvote[1090] <- 42.4
    roomdata_rand$county[1091] <- "Essex_NJ"
    roomdata_rand$trumpvote[1091] <- 20.7
    roomdata_rand$county[1092] <- "Cumberland_PA"
    roomdata_rand$trumpvote[1092] <- 57.1
    roomdata_rand$county[1093] <- "Danville_VA"
    roomdata_rand$trumpvote[1093] <- 38.7
    roomdata_rand$county[1094] <- "Placer_CA"
    roomdata_rand$trumpvote[1094] <- 52.5
    roomdata_rand$county[1095] <- "Douglas_NE"
    roomdata_rand$trumpvote[1095] <- 46.5
    roomdata_rand$county[1096] <- "Rutland_VT"
    roomdata_rand$trumpvote[1096] <- 45.1
    roomdata_rand$county[1097] <- "Lake_OH"
    roomdata_rand$trumpvote[1097] <- 55.5
    roomdata_rand$county[1098] <- "Will_IL"
    roomdata_rand$trumpvote[1098] <- 44.6
    roomdata_rand$county[1099] <- "Jefferson_AR"
    roomdata_rand$trumpvote[1099] <- 35.9
  
    roomdata_rand$county[1100] <- "Lafourche_LA"
    roomdata_rand$trumpvote[1100] <- 76.7
    roomdata_rand$county[1101] <- "Crawford_KS"
    roomdata_rand$trumpvote[1101] <- 58.3
    roomdata_rand$county[1102] <- "King_WA"
    roomdata_rand$trumpvote[1102] <- 21.7
    roomdata_rand$county[1103] <- "Woodbury_IA"
    roomdata_rand$trumpvote[1103] <- 57.4
    roomdata_rand$county[1104] <- "Douglas_NE"
    roomdata_rand$trumpvote[1104] <- 46.5
    roomdata_rand$county[1105] <- "Middlesex_MA"
    roomdata_rand$trumpvote[1105] <- 28.2
    roomdata_rand$county[1106] <- "Kent_DE"
    roomdata_rand$trumpvote[1106] <- 49.8
    roomdata_rand$county[1107] <- "Alachua_FL"
    roomdata_rand$trumpvote[1107] <- 36.4
    roomdata_rand$county[1108] <- "Fayette_KY"
    roomdata_rand$trumpvote[1108] <- 41.8
    roomdata_rand$county[1109] <- "Muskingum_OH"
    roomdata_rand$trumpvote[1109] <- 65.1
    roomdata_rand$county[1110] <- "Wayne_MI"
    roomdata_rand$trumpvote[1110] <- 29.4
    roomdata_rand$county[1111] <- "Wake_NC"
    roomdata_rand$trumpvote[1111] <- 37.9
    roomdata_rand$county[1112] <- "Lycoming_PA"
    roomdata_rand$trumpvote[1112] <- 70.5
    roomdata_rand$county[1113] <- "Lafayette_LA"
    roomdata_rand$trumpvote[1113] <- 64.6
    roomdata_rand$county[1114] <- "Palm Beach_FL"
    roomdata_rand$trumpvote[1114] <- 41.2
    roomdata_rand$county[1115] <- "Columbia_FL"
    roomdata_rand$trumpvote[1115] <- 70.9
    roomdata_rand$county[1116] <- "Davidson_TN"
    roomdata_rand$trumpvote[1116] <- 34.3
    roomdata_rand$county[1117] <- "Madison_AL"
    roomdata_rand$trumpvote[1117] <- 55.9
    roomdata_rand$county[1118] <- "La Crosse_WI"
    roomdata_rand$trumpvote[1118] <- 42
    roomdata_rand$county[1119] <- "Lancaster_NE"
    roomdata_rand$trumpvote[1119] <- 46.6
    roomdata_rand$county[1120] <- "Worcester_MA"
    roomdata_rand$trumpvote[1120] <- 41.2
    roomdata_rand$county[1121] <- "Lee_FL"
    roomdata_rand$trumpvote[1121] <- 58.7
    roomdata_rand$county[1122] <- "CuyahogaCounty_OH" 
    roomdata_rand$trumpvote[1122] <- 30.8
    roomdata_rand$county[1123] <- "CookCounty_IL"
    roomdata_rand$trumpvote[1123] <- 21.4
    roomdata_rand$county[1124] <- "Norfolk_MA"
    roomdata_rand$trumpvote[1124] <- 33.3
    roomdata_rand$county[1125] <- "Alaska"
    roomdata_rand$trumpvote[1125] <- 51.28
    roomdata_rand$county[1126] <- "La Crosse_WI"
    roomdata_rand$trumpvote[1126] <- 42
    roomdata_rand$county[1127] <- "Franklin_OH"
    roomdata_rand$trumpvote[1127] <- 34.7
    roomdata_rand$county[1128] <- "Windham_VT"
    roomdata_rand$trumpvote[1128] <- 25.8
    roomdata_rand$county[1129] <- "St. Louis City_MO"
    roomdata_rand$trumpvote[1129] <- 15.9
    roomdata_rand$county[1130] <- "Grafton_NH"
    roomdata_rand$trumpvote[1130] <- 37.9
    roomdata_rand$county[1131] <- "Marion_IA"
    roomdata_rand$trumpvote[1131] <- 62.3
    roomdata_rand$county[1132] <- "King_WA"
    roomdata_rand$trumpvote[1132] <- 21.7
    roomdata_rand$county[1133] <- "Pulaski_AR"
    roomdata_rand$trumpvote[1133] <- 38.4
    roomdata_rand$county[1134] <- "Richmond City_VA"
    roomdata_rand$trumpvote[1134] <- 15
    roomdata_rand$county[1135] <- "Madison_AL"
    roomdata_rand$trumpvote[1135] <- 55.9
    roomdata_rand$county[1136] <- "HennepinCounty_MN"
    roomdata_rand$trumpvote[1136] <- 28.5
    roomdata_rand$county[1137] <- "Kanawha_WV"
    roomdata_rand$trumpvote[1137] <- 58
    roomdata_rand$county[1138] <- "Peoria_IL"
    roomdata_rand$trumpvote[1138] <- 45.6
    roomdata_rand$county[1139] <- "Wood_WI"
    roomdata_rand$trumpvote[1139] <- 57
    roomdata_rand$county[1140] <- "Suffolk_MA" 
    roomdata_rand$trumpvote[1140] <- 16.5
    roomdata_rand$county[1141] <- "Tazewell_VA"
    roomdata_rand$trumpvote[1141] <- 82
    roomdata_rand$county[1142] <- "Cumberland_PA"
    roomdata_rand$trumpvote[1142] <- 57.1
    roomdata_rand$county[1143] <- "Manitowoc_WI"
    roomdata_rand$trumpvote[1143] <- 58.1
    roomdata_rand$county[1144] <- "Monroe_IN"
    roomdata_rand$trumpvote[1144] <- 35.6
    roomdata_rand$county[1145] <- "Westmoreland_PA"
    roomdata_rand$trumpvote[1145] <- 64.1
    roomdata_rand$county[1146] <- "Polk_FL"
    roomdata_rand$trumpvote[1146] <- 55.4
    roomdata_rand$county[1147] <- "Hillsborough_NH"
    roomdata_rand$trumpvote[1147] <- 47.5
    roomdata_rand$county[1148] <- "Yankton_SD"
    roomdata_rand$trumpvote[1148] <- 58.8
    roomdata_rand$county[1149] <- "Wise_VA"
    roomdata_rand$trumpvote[1149] <- 79.9
    roomdata_rand$county[1150] <- "SedgwickCounty_KA"
    roomdata_rand$trumpvote[1150] <- 56
    roomdata_rand$county[1151] <- "Winchester City_VA"
    roomdata_rand$trumpvote[1151] <- 45.3
    roomdata_rand$county[1152] <- "Dallas_TX"
    roomdata_rand$trumpvote[1152] <- 34.9
    roomdata_rand$county[1153] <- "El Paso_CO"
    roomdata_rand$trumpvote[1153] <- 56.3
    roomdata_rand$county[1154] <- "Faulkner_AR"
    roomdata_rand$trumpvote[1154] <- 61.8
    roomdata_rand$county[1155] <- "King_WA"
    roomdata_rand$trumpvote[1155] <- 21.7
    roomdata_rand$county[1156] <- "Erie_NY"
    roomdata_rand$trumpvote[1156] <- 45.4
    roomdata_rand$county[1157] <- "Broome_NY"
    roomdata_rand$trumpvote[1157] <- 49
    roomdata_rand$county[1158] <- "Dupage_IL"
    roomdata_rand$trumpvote[1158] <- 39.8
    roomdata_rand$county[1159] <- "Brazoria_TX"
    roomdata_rand$trumpvote[1159] <- 60.4
    roomdata_rand$county[1160] <- "Montgomery_PA"
    roomdata_rand$trumpvote[1160] <- 37.6
    roomdata_rand$county[1161] <- "TravisCounty_TX"
    roomdata_rand$trumpvote[1161] <- 27.4
    roomdata_rand$county[1162] <- "Sioux_IA"
    roomdata_rand$trumpvote[1162] <- 82.1
    roomdata_rand$county[1163] <- "Grafton_NH"
    roomdata_rand$trumpvote[1163] <- 37.9
    roomdata_rand$county[1164] <- "Gunnison_CO"
    roomdata_rand$trumpvote[1164] <- 34.9
    roomdata_rand$county[1165] <- "New York_NY"
    roomdata_rand$trumpvote[1165] <- 10
    roomdata_rand$county[1166] <- "Miami-Dade_FL"
    roomdata_rand$trumpvote[1166] <- 34.1
    roomdata_rand$county[1167] <- "Franklin_TN"
    roomdata_rand$trumpvote[1167] <- 70.4
    roomdata_rand$county[1168] <- "Lauderdale_AL"
    roomdata_rand$trumpvote[1168] <- 71.5
    roomdata_rand$county[1169] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[1169] <- 23.4
    roomdata_rand$county[1170] <- "Jackson_NC"
    roomdata_rand$trumpvote[1170] <- 53.9
    roomdata_rand$county[1171] <- "Charleston_SC"
    roomdata_rand$trumpvote[1171] <- 42.8
    roomdata_rand$county[1172] <- "Orange_FL"
    roomdata_rand$trumpvote[1172] <- 35.7
    roomdata_rand$county[1173] <- "Jackson_MO"
    roomdata_rand$trumpvote[1173] <- 39
    roomdata_rand$county[1174] <- "Worcester_MA"
    roomdata_rand$trumpvote[1174] <- 41.2
    roomdata_rand$county[1175] <- "Essex_MA"
    roomdata_rand$trumpvote[1175] <- 36
    roomdata_rand$county[1176] <- "Madison_TN"
    roomdata_rand$trumpvote[1176] <- 56.5
    roomdata_rand$county[1177] <- "Johnson_TX"
    roomdata_rand$trumpvote[1177] <- 77.5
    roomdata_rand$county[1178] <- "Butler_OH"
    roomdata_rand$trumpvote[1178] <- 62
    roomdata_rand$county[1179] <- "Providence_RI"
    roomdata_rand$trumpvote[1179] <- 37.3
    roomdata_rand$county[1180] <- "Clark_NV"
    roomdata_rand$trumpvote[1180] <- 41.8
    roomdata_rand$county[1181] <- "Hampden_MA"
    roomdata_rand$trumpvote[1181] <- 39.1
    roomdata_rand$county[1182] <- "Niagara_NY"
    roomdata_rand$trumpvote[1182] <- 57.2
    roomdata_rand$county[1183] <- "Weber_UT"
    roomdata_rand$trumpvote[1183] <- 47.2
    roomdata_rand$county[1184] <- "GuilfordCounty_NC"
    roomdata_rand$trumpvote[1184] <- 38.7
    roomdata_rand$county[1185] <- "RamseyCounty_MN"
    roomdata_rand$trumpvote[1185] <- 26.3
    roomdata_rand$county[1186] <- "Beaverhead_MT"
    roomdata_rand$trumpvote[1186] <- 69.1
    roomdata_rand$county[1187] <- "Oakland_MI"
    roomdata_rand$trumpvote[1187] <- 43.6
    roomdata_rand$county[1188] <- "Harris_TX"
    roomdata_rand$trumpvote[1188] <- 41.8
    roomdata_rand$county[1189] <- "Lubbock_TX"
    roomdata_rand$trumpvote[1189] <- 66.9
    roomdata_rand$county[1190] <- "Santa Fe_NM"
    roomdata_rand$trumpvote[1190] <- 20.2
    roomdata_rand$county[1191] <- "Kosciusko_IN"
    roomdata_rand$trumpvote[1191] <- 74.9
    roomdata_rand$county[1192] <- "Bulloch_GA"
    roomdata_rand$trumpvote[1192] <- 59.9
    roomdata_rand$county[1193] <- "Dougherty_GA"
    roomdata_rand$trumpvote[1193] <- 30.1
    roomdata_rand$county[1194] <- "Rock_WI"
    roomdata_rand$trumpvote[1194] <- 42 
    roomdata_rand$county[1195] <- "Brooke_WV"
    roomdata_rand$trumpvote[1195] <- 68.9
    roomdata_rand$county[1196] <- "Penobscot_ME"
    roomdata_rand$trumpvote[1196] <- 51.9
    roomdata_rand$county[1197] <- "Shelby_TN"
    roomdata_rand$trumpvote[1197] <- 34.6
    roomdata_rand$county[1198] <- "Chittenden_VT"
    roomdata_rand$trumpvote[1198] <- 23.7
    roomdata_rand$county[1199] <- "Washington_DC"
    roomdata_rand$trumpvote[1199] <- 4.1
    
    
    roomdata_rand$county[1200] <- "Kenosha_WI"
    roomdata_rand$trumpvote[1200] <- 47.5
    roomdata_rand$county[1201] <- "Middlesex_MA"
    roomdata_rand$trumpvote[1201] <- 28.2 
    roomdata_rand$county[1202] <- "Whitman_WA"
    roomdata_rand$trumpvote[1202] <- 45
    roomdata_rand$county[1203] <- "Lake_SD"
    roomdata_rand$trumpvote[1203] <- 59.5
    roomdata_rand$county[1204] <- "Washington_UT"
    roomdata_rand$trumpvote[1204] <- 68.6
    roomdata_rand$county[1205] <- "Latah_ID"
    roomdata_rand$trumpvote[1205] <- 40
    roomdata_rand$county[1206] <- "Erie_NY"
    roomdata_rand$trumpvote[1206] <- 45.4
    roomdata_rand$county[1207] <- "Wake_NC"
    roomdata_rand$trumpvote[1207] <- 37.9
    roomdata_rand$county[1208] <- "Bibb_GA"
    roomdata_rand$trumpvote[1208] <- 38.7
    roomdata_rand$county[1209] <- "Calcasieu_LA"
    roomdata_rand$trumpvote[1209] <- 64.7
    roomdata_rand$county[1210] <- "Middlesex_MA"
    roomdata_rand$trumpvote[1210] <- 28.2
    roomdata_rand$county[1211] <- "SpartanburgCounty_SC"
    roomdata_rand$trumpvote[1211] <- 63
    roomdata_rand$county[1212] <- "Clay_MO"
    roomdata_rand$trumpvote[1212] <- 52.5
    roomdata_rand$county[1213] <- "Jackson_MO"
    roomdata_rand$trumpvote[1213] <- 39
    roomdata_rand$county[1214] <- "Mclennan_TX"
    roomdata_rand$trumpvote[1214] <- 61.7
    roomdata_rand$county[1215] <- "Cabell_WV"
    roomdata_rand$trumpvote[1215] <- 60.1
    roomdata_rand$county[1216] <- "Norfolk_MA"
    roomdata_rand$trumpvote[1216] <- 33.3
    roomdata_rand$county[1217] <- "Boulder_CO"
    roomdata_rand$trumpvote[1217] <- 21.9
    roomdata_rand$county[1218] <- "Northampton_PA"
    roomdata_rand$trumpvote[1218] <- 50
    roomdata_rand$county[1219] <- "Pulaski_AR"
    roomdata_rand$trumpvote[1219] <- 38.4
    roomdata_rand$county[1220] <- "Montgomery_PA"
    roomdata_rand$trumpvote[1220] <- 37.6
    roomdata_rand$county[1221] <- "Boyle_KY"
    roomdata_rand$trumpvote[1221] <- 62.1
    roomdata_rand$county[1222] <- "Clark_OH"
    roomdata_rand$trumpvote[1222] <- 57.5
    roomdata_rand$county[1223] <- "Prince Edward_VA"
    roomdata_rand$trumpvote[1223] <- 45
    roomdata_rand$county[1224] <- "Hampshire_MA"
    roomdata_rand$trumpvote[1224] <- 26.8
    roomdata_rand$county[1225] <- "Duval_FL"
    roomdata_rand$trumpvote[1225] <- 49
    roomdata_rand$county[1226] <- "Hudson_NJ"
    roomdata_rand$trumpvote[1226] <- 22.6
    roomdata_rand$county[1227] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[1227] <- 23.4
    roomdata_rand$county[1228] <- "Shasta_CA"
    roomdata_rand$trumpvote[1228] <- 65.6
    roomdata_rand$county[1229] <- "Hancock_ME"
    roomdata_rand$trumpvote[1229] <- 42.8
    roomdata_rand$county[1230] <- "Berrien_MI"
    roomdata_rand$trumpvote[1230] <- 53.8
    roomdata_rand$county[1231] <- "Union_OR"
    roomdata_rand$trumpvote[1231] <- 67.2
    roomdata_rand$county[1232] <- "Lake_FL"
    roomdata_rand$trumpvote[1232] <- 60
    roomdata_rand$county[1233] <- "Madison_KY"
    roomdata_rand$trumpvote[1233] <- 62.8
    roomdata_rand$county[1234] <- "Denver_CO"
    roomdata_rand$trumpvote[1234] <- 18.8
    roomdata_rand$county[1235] <- "Hidalgo_TX"
    roomdata_rand$trumpvote[1235] <- 28.1
    roomdata_rand$county[1236] <- "Pulaski_AR"
    roomdata_rand$trumpvote[1236] <- 38.4
    roomdata_rand$county[1237] <- "WashoeCounty_NV"
    roomdata_rand$trumpvote[1237] <- 45
    roomdata_rand$county[1238] <- "Bergen_NJ"
    roomdata_rand$trumpvote[1238] <- 42.5
    roomdata_rand$county[1239] <- "Luzerene_PA"
    roomdata_rand$trumpvote[1239] <- 58.4
    roomdata_rand$county[1240] <- "Cumberland_ME"
    roomdata_rand$trumpvote[1240] <- 33.7
    roomdata_rand$county[1241] <- "PhiladelphiaCounty_PA"
    roomdata_rand$trumpvote[1241] <- 15.5
    roomdata_rand$county[1242] <- "Merrimack_NH"
    roomdata_rand$trumpvote[1242] <- 45.9
    roomdata_rand$county[1243] <- "Logan_IL"
    roomdata_rand$trumpvote[1243] <- 67.3
    roomdata_rand$county[1244] <- "Delaware_PA"
    roomdata_rand$trumpvote[1244] <- 37.4
    roomdata_rand$county[1245] <- "Jackson_OR"
    roomdata_rand$trumpvote[1245] <- 51.1
    roomdata_rand$county[1246] <- "Clark_AR"
    roomdata_rand$trumpvote[1246] <- 51.7
    roomdata_rand$county[1247] <- "Cheshire_NH"
    roomdata_rand$trumpvote[1247] <- 41
    roomdata_rand$county[1248] <- "Lancaster_PA"
    roomdata_rand$trumpvote[1248] <- 57.3
    roomdata_rand$county[1249] <- "New York_NY"
    roomdata_rand$trumpvote[1249] <- 10
    roomdata_rand$county[1250] <- "Baltimore City_MD"
    roomdata_rand$trumpvote[1250] <- 10.9
    roomdata_rand$county[1251] <- "Lake_IN"
    roomdata_rand$trumpvote[1251] <- 37.7
    roomdata_rand$county[1252] <- "SuffolkCounty_MA"
    roomdata_rand$trumpvote[1252] <- 16.5
    roomdata_rand$county[1253] <- "SaltLakeCounty_UT"
    roomdata_rand$trumpvote[1253] <- 32.6
    roomdata_rand$county[1254] <- "Kankakee_IL"
    roomdata_rand$trumpvote[1254] <- 53.9
    roomdata_rand$county[1255] <- "New Haven_CT"
    roomdata_rand$trumpvote[1255] <- 42.1
    roomdata_rand$county[1256] <- "Ashland_WI"
    roomdata_rand$trumpvote[1256] <- 43.3
    roomdata_rand$county[1257] <- "Fond du Lac_WI"
    roomdata_rand$trumpvote[1257] <- 60.8
    roomdata_rand$county[1258] <- "Stearns_MN"
    roomdata_rand$trumpvote[1258] <- 60.3
    roomdata_rand$county[1259] <- "DuvalCounty_FL"
    roomdata_rand$trumpvote[1259] <- 49
    roomdata_rand$county[1260] <- "Stearns_MN"
    roomdata_rand$trumpvote[1260] <- 60.3
    roomdata_rand$county[1261] <- "Ellis_KS"
    roomdata_rand$trumpvote[1261] <- 71.3
    roomdata_rand$county[1262] <- "St. Louis_MO"
    roomdata_rand$trumpvote[1262] <- 39.5
    roomdata_rand$county[1263] <- "Humboldt_CA"
    roomdata_rand$trumpvote[1263] <- 32.4
    roomdata_rand$county[1264] <- "Richmond_GA"
    roomdata_rand$trumpvote[1264] <- 32.6
    roomdata_rand$county[1265] <- "Grady_OK"
    roomdata_rand$trumpvote[1265] <- 77.7
    roomdata_rand$county[1266] <- "New London_CT"
    roomdata_rand$trumpvote[1266] <- 43.8
    roomdata_rand$county[1267] <- "MarionCounty_FL"
    roomdata_rand$trumpvote[1267] <- 61.7
    roomdata_rand$county[1268] <- "Dallas_TX"
    roomdata_rand$trumpvote[1268] <- 34.9
    roomdata_rand$county[1269] <- "Lenawee_MI"
    roomdata_rand$trumpvote[1269] <- 57.6
    roomdata_rand$county[1270] <- "Barnstable_MA"
    roomdata_rand$trumpvote[1270] <- 40.6
    roomdata_rand$county[1271] <- "Calloway_KY"
    roomdata_rand$trumpvote[1271] <- 64.6
    roomdata_rand$county[1272] <- "Lewis and Clark_MT"
    roomdata_rand$trumpvote[1272] <- 49.3
    roomdata_rand$county[1273] <- "Dubuque_IA"
    roomdata_rand$trumpvote[1273] <- 47.7
    roomdata_rand$county[1274] <- "MonroeCounty_NY"
    roomdata_rand$trumpvote[1274] <- 40.3
    roomdata_rand$county[1275] <- "Minnehaha_SD"
    roomdata_rand$trumpvote[1275] <- 53.7
    roomdata_rand$county[1276] <- "Marion_WV"
    roomdata_rand$trumpvote[1276] <- 63.7
    roomdata_rand$county[1277] <- "Faulkner_AR"
    roomdata_rand$trumpvote[1277] <- 61.8
    roomdata_rand$county[1278] <- "Clinton_NY"
    roomdata_rand$trumpvote[1278] <- 46.4
    roomdata_rand$county[1279] <- "HillsboroughCounty_FL" 
    roomdata_rand$trumpvote[1279] <- 44.7
    roomdata_rand$county[1280] <- "New York_NY"
    roomdata_rand$trumpvote[1280] <- 10
    roomdata_rand$county[1281] <- "Phelps_MO"
    roomdata_rand$trumpvote[1281] <- 68.6
    roomdata_rand$county[1282] <- "Nassau_NY"
    roomdata_rand$trumpvote[1282] <- 45.9
    roomdata_rand$county[1283] <- "Washington_TN"
    roomdata_rand$trumpvote[1283] <- 69.2
    roomdata_rand$county[1284] <- "Calhoun_AL"
    roomdata_rand$trumpvote[1284] <- 69.2
    roomdata_rand$county[1285] <- "MilwaukeeCounty_WI"
    roomdata_rand$trumpvote[1285] <- 29
    roomdata_rand$county[1286] <- "Denver_CO"
    roomdata_rand$trumpvote[1286] <- 18.8
    roomdata_rand$county[1287] <- "Beaufort_SC"
    roomdata_rand$trumpvote[1287] <- 54.9
    roomdata_rand$county[1288] <- "Washington_AR"
    roomdata_rand$trumpvote[1288] <- 50.8
    roomdata_rand$county[1289] <- "Monmouth_NJ"
    roomdata_rand$trumpvote[1289] <- 53.1
    roomdata_rand$county[1290] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[1290] <- 23.4
    roomdata_rand$county[1291] <- "Pike_AL"
    roomdata_rand$trumpvote[1291] <- 59
    roomdata_rand$county[1292] <- "Stephens_GA"
    roomdata_rand$trumpvote[1292] <- 78.7
    roomdata_rand$county[1293] <- "Jessamine_KY"
    roomdata_rand$trumpvote[1293] <- 66.4
    roomdata_rand$county[1294] <- "Atchison_KS"
    roomdata_rand$trumpvote[1294] <- 62.2
    roomdata_rand$county[1295] <- "Okaloosa_FL"
    roomdata_rand$trumpvote[1295] <- 71.3
    roomdata_rand$county[1296] <- "Lexington City_VA"
    roomdata_rand$trumpvote[1296] <- 31.3
    roomdata_rand$county[1297] <- "Chittenden_VT"
    roomdata_rand$trumpvote[1297] <- 23.7
    roomdata_rand$county[1298] <- "Weld_CO"
    roomdata_rand$trumpvote[1298] <- 56.5
    roomdata_rand$county[1299] <- "DuPage_IL"
    roomdata_rand$trumpvote[1299] <- 39.8
    
    roomdata_rand$county[1300] <- "Onondaga_NY"
    roomdata_rand$trumpvote[1300] <- 40.8
    roomdata_rand$county[1301] <- "Delaware_NY" 
    roomdata_rand$trumpvote[1301] <- 61.9
    roomdata_rand$county[1302] <- "Roosevelt_NM"
    roomdata_rand$trumpvote[1302] <- 65.4
    roomdata_rand$county[1303] <- "Fulton_GA"
    roomdata_rand$trumpvote[1303] <- 27.1
    roomdata_rand$county[1304] <- "Middlesex_MA"
    roomdata_rand$trumpvote[1304] <- 28.2
    roomdata_rand$county[1305] <- "Jefferson_TN"
    roomdata_rand$trumpvote[1305] <- 77.7
    roomdata_rand$county[1306] <- "Towns_GA"
    roomdata_rand$trumpvote[1306] <- 79.9
    roomdata_rand$county[1307] <- "Cumberland_ME"
    roomdata_rand$trumpvote[1307] <- 33.7
    roomdata_rand$county[1308] <- "Aroostook_ME"
    roomdata_rand$trumpvote[1308] <- 55.5
    roomdata_rand$county[1309] <- "Gwinnett_GA"
    roomdata_rand$trumpvote[1309] <- 45.2
    roomdata_rand$county[1310] <- "Luzerne_PA"
    roomdata_rand$trumpvote[1310] <- 58.4
    roomdata_rand$county[1311] <- "LynchburgCity_VA"
    roomdata_rand$trumpvote[1311] <- 50.9
    roomdata_rand$county[1312] <- "New York_NY"
    roomdata_rand$trumpvote[1312] <- 10
    roomdata_rand$county[1313] <- "Leavenworth_KS"
    roomdata_rand$trumpvote[1313] <- 58.6
    roomdata_rand$county[1314] <- "Polk_OR"
    roomdata_rand$trumpvote[1314] <- 49.5
    roomdata_rand$county[1315] <- "Wake_NC"
    roomdata_rand$trumpvote[1315] <- 37.9
    roomdata_rand$county[1316] <- "OrleansParish_LA"
    roomdata_rand$trumpvote[1316] <- 14.7
    roomdata_rand$county[1317] <- "TravisCounty_TX"
    roomdata_rand$trumpvote[1317] <- 27.4
    roomdata_rand$county[1318] <- "St. Louis_MO"
    roomdata_rand$trumpvote[1318] <- 39.5
    roomdata_rand$county[1319] <- "Suffolk_NY"
    roomdata_rand$trumpvote[1319] <- 52.5
    roomdata_rand$county[1320] <- "Dunn_WI"
    roomdata_rand$trumpvote[1320] <- 52.1
    roomdata_rand$county[1321] <- "Winnebago_WI"
    roomdata_rand$trumpvote[1321] <- 50.6
    roomdata_rand$county[1322] <- "Sangamon_IL"
    roomdata_rand$trumpvote[1322] <- 51.6
    roomdata_rand$county[1323] <- "PinellasCounty_FL"
    roomdata_rand$trumpvote[1323] <- 48.6
    roomdata_rand$county[1324] <- "Centre_PA"
    roomdata_rand$trumpvote[1324] <- 46.6
    roomdata_rand$county[1325] <- "Kaufman_TX"
    roomdata_rand$trumpvote[1325] <- 72.1
    roomdata_rand$county[1326] <- "Ohio_WV"
    roomdata_rand$trumpvote[1326] <- 62.2
    roomdata_rand$county[1327] <- "Polk_IA"
    roomdata_rand$trumpvote[1327] <- 40.9
    roomdata_rand$county[1328] <- "Morris_NJ"
    roomdata_rand$trumpvote[1328] <- 50.4
    roomdata_rand$county[1329] <- "Independence_AR"
    roomdata_rand$trumpvote[1329] <- 73
    roomdata_rand$county[1330] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[1330] <- 23.4
    roomdata_rand$county[1331] <- "Rogers_OK"
    roomdata_rand$trumpvote[1331] <- 75.7
    roomdata_rand$county[1332] <- "Clark_NV"
    roomdata_rand$trumpvote[1332] <- 41.8
    roomdata_rand$county[1333] <- "Taylor_TX"
    roomdata_rand$trumpvote[1333] <- 73.3
    roomdata_rand$county[1334] <- "Cumberland_NC" 
    roomdata_rand$trumpvote[1334] <- 40.3
    roomdata_rand$county[1335] <- "Pontotoc_OK"
    roomdata_rand$trumpvote[1335] <- 70.3
    roomdata_rand$county[1336] <- "Delaware_OH"
    roomdata_rand$trumpvote[1336] <- 55.6
    roomdata_rand$county[1337] <- "Passaic_NJ"
    roomdata_rand$trumpvote[1337] <- 37.8
    roomdata_rand$county[1338] <- "Darlington_SC"
    roomdata_rand$trumpvote[1338] <- 50.5
    roomdata_rand$county[1339] <- "Greenville_SC"
    roomdata_rand$trumpvote[1339] <- 59.4
    roomdata_rand$county[1340] <- "Erie_PA"
    roomdata_rand$trumpvote[1340] <- 48.8
    roomdata_rand$county[1341] <- "Marion_IN"
    roomdata_rand$trumpvote[1341] <- 36.2
    roomdata_rand$county[1342] <- "Scioto_OH"
    roomdata_rand$trumpvote[1342] <- 66.7
    roomdata_rand$county[1343] <- "Pope_AR"
    roomdata_rand$trumpvote[1343] <- 72.1
    roomdata_rand$county[1344] <- "Douglas_WI"
    roomdata_rand$trumpvote[1344] <- 43.5
    roomdata_rand$county[1345] <- "BronxCounty_NY"
    roomdata_rand$trumpvote[1345] <- 9.6
    roomdata_rand$county[1346] <- "Riverside_CA"
    roomdata_rand$trumpvote[1346] <- 46.7
    roomdata_rand$county[1347] <- "New York_NY"
    roomdata_rand$trumpvote[1347] <- 10
    roomdata_rand$county[1348] <- "Marquette_MI"
    roomdata_rand$trumpvote[1348] <- 44.5
    roomdata_rand$county[1349] <- "Brewster_TX"
    roomdata_rand$trumpvote[1349] <- 49.1
    roomdata_rand$county[1350] <- "Washington_VA"
    roomdata_rand$trumpvote[1350] <- 75
    roomdata_rand$county[1351] <- "San_Francisco_CA"
    roomdata_rand$trumpvote[1351] <- 9.4
    roomdata_rand$county[1352] <- "Lake_FL"
    roomdata_rand$trumpvote[1352] <- 60
    roomdata_rand$county[1353] <- "Grant_NM"
    roomdata_rand$trumpvote[1353] <- 41.3
    roomdata_rand$county[1354] <- "Hill_MT"
    roomdata_rand$trumpvote[1354] <- 54.1
    roomdata_rand$county[1355] <- "Sarpy_NE"
    roomdata_rand$trumpvote[1355] <- 57.4
    roomdata_rand$county[1356] <- "Middlesex_MA"
    roomdata_rand$trumpvote[1356] <- 28.2
    roomdata_rand$county[1357] <- "Franklin_OH"
    roomdata_rand$trumpvote[1357] <- 34.7
    roomdata_rand$county[1358] <- "MilwaukeeCounty_WI"
    roomdata_rand$trumpvote[1358] <- 29
    roomdata_rand$county[1359] <- "Miami-Dade_FL"
    roomdata_rand$trumpvote[1359] <- 34.1
    roomdata_rand$county[1360] <- "Suffolk_MA"
    roomdata_rand$trumpvote[1360] <- 16.5
    roomdata_rand$county[1361] <- "Harnett_NC"
    roomdata_rand$trumpvote[1361] <- 60.7
    roomdata_rand$county[1362] <- "Jackson_MI"
    roomdata_rand$trumpvote[1362] <- 57.2
    roomdata_rand$county[1363] <- "Lincoln_LA"
    roomdata_rand$trumpvote[1363] <- 57.7
    roomdata_rand$county[1364] <- "Woodford_IL"
    roomdata_rand$trumpvote[1364] <- 68
    roomdata_rand$county[1365] <- "Burleigh_ND"
    roomdata_rand$trumpvote[1365] <- 69.3
    roomdata_rand$county[1366] <- "Ouachita_LA"
    roomdata_rand$trumpvote[1366] <- 61.4
    roomdata_rand$county[1367] <- "Pitt_NC"
    roomdata_rand$trumpvote[1367] <- 45
    roomdata_rand$county[1368] <- "Providence_RI"
    roomdata_rand$trumpvote[1368] <- 37.6
    roomdata_rand$county[1369] <- "Berks_PA"
    roomdata_rand$trumpvote[1369] <- 52.9
    roomdata_rand$county[1370] <- "Wicomico_MD"
    roomdata_rand$trumpvote[1370] <- 53.8
    roomdata_rand$county[1371] <- "Union_NC"
    roomdata_rand$trumpvote[1371] <- 64
    roomdata_rand$county[1372] <- "Boone_MO"
    roomdata_rand$trumpvote[1372] <- 43.4
    roomdata_rand$county[1373] <- "Sheboygan_WI"
    roomdata_rand$trumpvote[1373] <- 55.5
    roomdata_rand$county[1374] <- "Allen_IN"
    roomdata_rand$trumpvote[1374] <- 57.5
    roomdata_rand$county[1375] <- "Polk_MO"
    roomdata_rand$trumpvote[1375] <- 76.1
    roomdata_rand$county[1376] <- "Hamilton_TN"
    roomdata_rand$trumpvote[1376] <- 55.8
    roomdata_rand$county[1377] <- "Union_NJ"
    roomdata_rand$trumpvote[1377] <- 30.8
    roomdata_rand$county[1378] <- "Coffee_GA"
    roomdata_rand$trumpvote[1378] <- 68.9
    roomdata_rand$county[1379] <- "Hillsborough_NH"
    roomdata_rand$trumpvote[1379] <- 47.4
    roomdata_rand$county[1380] <- "Cass_ND"
    roomdata_rand$trumpvote[1380] <- 50.4
    roomdata_rand$county[1381] <- "Gibson_IN"
    roomdata_rand$trumpvote[1381] <- 71.6
    roomdata_rand$county[1382] <- "Erie_NY"
    roomdata_rand$trumpvote[1382] <- 45.4
    roomdata_rand$county[1383] <-  "Grand Forks_ND"
    roomdata_rand$trumpvote[1383] <- 54.9
    roomdata_rand$county[1384] <- "OrleansParish_LA"
    roomdata_rand$trumpvote[1384] <- 14.7
    roomdata_rand$county[1385] <- "Santa Clara_CA"
    roomdata_rand$trumpvote[1385] <- 20.9
    roomdata_rand$county[1386] <- "New York_NY"
    roomdata_rand$trumpvote[1386] <- 10
    roomdata_rand$county[1387] <- "OrleansParish_LA"
    roomdata_rand$trumpvote[1387] <- 14.7
    roomdata_rand$county[1388] <- "Alamosa_CO"
    roomdata_rand$trumpvote[1388] <- 43.9
    roomdata_rand$county[1389] <- "Orange_CA"
    roomdata_rand$trumpvote[1389] <- 43.3
    roomdata_rand$county[1390] <- "Callaway_MO"
    roomdata_rand$trumpvote[1390] <- 68.2
    roomdata_rand$county[1391] <- "Carroll_TN"
    roomdata_rand$trumpvote[1391] <- 74.9
    roomdata_rand$county[1392] <- "New York_NY"
    roomdata_rand$trumpvote[1392] <- 10
    roomdata_rand$county[1393] <- "Duval_FL"
    roomdata_rand$trumpvote[1393] <- 49
    roomdata_rand$county[1394] <- "Avery_NC" 
    roomdata_rand$trumpvote[1394] <- 77.2
    roomdata_rand$county[1395] <- "Orange_VT"
    roomdata_rand$trumpvote[1395] <- 37.1
    roomdata_rand$county[1396] <- "Riverside_CA"
    roomdata_rand$trumpvote[1396] <- 46.7
    roomdata_rand$county[1397] <- "Lehigh_PA"
    roomdata_rand$trumpvote[1397] <- 45.9
    roomdata_rand$county[1398] <- "Grant_IN"
    roomdata_rand$trumpvote[1398] <- 67.4
    roomdata_rand$county[1399] <- "East Baton Rouge_LA"
    roomdata_rand$trumpvote[1399] <- 43.1
  
    roomdata_rand$county[1400] <- "Androscoggin_ME"
    roomdata_rand$trumpvote[1400] <- 50.9
    roomdata_rand$county[1401] <- "Middlesex_MA"
    roomdata_rand$trumpvote[1401] <- 28.2
    roomdata_rand$county[1402] <- "King_WA"
    roomdata_rand$trumpvote[1402] <- 21.4
    roomdata_rand$county[1403] <- "Ada_ID"
    roomdata_rand$trumpvote[1403] <- 47.9
    roomdata_rand$county[1404] <- "Johnson_MO"
    roomdata_rand$trumpvote[1404] <- 65
    roomdata_rand$county[1405] <- "Essex_NJ"
    roomdata_rand$trumpvote[1405] <- 20.7
    roomdata_rand$county[1406] <- "Chester_TN"
    roomdata_rand$trumpvote[1406] <- 78.9
    roomdata_rand$county[1407] <- "Cumberland_PA"
    roomdata_rand$trumpvote[1407] <- 57.1
    roomdata_rand$county[1408] <- "Putnam_TN"
    roomdata_rand$trumpvote[1408] <- 70.4
    roomdata_rand$county[1409] <- "Greenwood_SC"
    roomdata_rand$trumpvote[1409] <- 59
    roomdata_rand$county[1410] <- "Benton_OR"
    roomdata_rand$trumpvote[1410] <- 28.6
    roomdata_rand$county[1411] <- "HonoluluCounty_HI"
    roomdata_rand$trumpvote[1411] <- 32
    roomdata_rand$county[1412] <- "Hamilton_TN"
    roomdata_rand$trumpvote[1412] <- 55.8
    roomdata_rand$county[1413] <- "Suffolk_MA"
    roomdata_rand$trumpvote[1413] <- 16.5
    roomdata_rand$county[1414] <- "Ottawa_MI"
    roomdata_rand$trumpvote[1414] <- 62.2
    roomdata_rand$county[1415] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[1415] <- 23.4
    roomdata_rand$county[1416] <- "Ventura_CA"
    roomdata_rand$trumpvote[1416] <- 38.6
    roomdata_rand$county[1417] <- "Stevens_MN"
    roomdata_rand$trumpvote[1417] <- 52.3
    roomdata_rand$county[1418] <- "Douglas_KS"
    roomdata_rand$trumpvote[1418] <- 29.7
    roomdata_rand$county[1419] <- "Los Angeles_CA" 
    roomdata_rand$trumpvote[1419] <- 23.4
    roomdata_rand$county[1420] <- "Los Angeles_CA"
    roomdata_rand$trumpvote[1420] <- 23.4
    roomdata_rand$county[1421] <- "Daviess_KY"
    roomdata_rand$trumpvote[1421] <- 63.1
    roomdata_rand$county[1422] <- "Bibb_GA"
    roomdata_rand$trumpvote[1422] <- 38.7
    roomdata_rand$county[1423] <- "Macoupin_IL"
    roomdata_rand$trumpvote[1423] <- 64.9
    roomdata_rand$county[1424] <- "York_SC"
    roomdata_rand$trumpvote[1424] <- 58.4
    roomdata_rand$county[1425] <- "PhiladelphiaCounty_PA"
    roomdata_rand$trumpvote[1425] <- 15.5
    roomdata_rand$county[1426] <- "Seward_NE"
    roomdata_rand$trumpvote[1426] <- 70.3
    roomdata_rand$county[1427] <- "Palm_Beach_FL"
    roomdata_rand$trumpvote[1427] <- 41.2
    roomdata_rand$county[1428] <- "Franklin_KY"
    roomdata_rand$trumpvote[1428] <- 49.5
    roomdata_rand$county[1429] <- "Roanoke_VA"
    roomdata_rand$trumpvote[1429] <- 61.5
    roomdata_rand$county[1430] <- "Lowndes_GA"
    roomdata_rand$trumpvote[1430] <- 57.9
    roomdata_rand$county[1431] <- "Cleveland_NC"
    roomdata_rand$trumpvote[1431] <- 64.3
    roomdata_rand$county[1432] <- "Erie_NY"
    roomdata_rand$trumpvote[1432] <- 45.4
    roomdata_rand$county[1433] <- "Spokane_WA"
    roomdata_rand$trumpvote[1433] <- 49.8
    roomdata_rand$county[1434] <- "Linn_IA"
    roomdata_rand$trumpvote[1434] <- 42
    roomdata_rand$county[1435] <- "CookCounty_IL"
    roomdata_rand$trumpvote[1435] <- 21.4
    roomdata_rand$county[1436] <- "Knox_TN"
    roomdata_rand$trumpvote[1436] <- 59
    roomdata_rand$county[1437] <- "HampdenCounty_MA"
    roomdata_rand$trumpvote[1437] <- 39
    roomdata_rand$county[1438] <- "Tippah_MS"
    roomdata_rand$trumpvote[1438] <- 78.6
    roomdata_rand$county[1439] <- "New York_NY"
    roomdata_rand$trumpvote[1439] <- 10
  
  
# Balance Test- all valid emails (undeliverable and auto-replies deleted)
# Creating dataset without undeliverable and auto-replies
exclude_autoreply <- roomdata_rand[roomdata_rand$reply != "NA", ]

# Balance Tests for valid emails
# Balance Test Model- Liberal
# Any college characteristics predict being in the Liberal Treatment?
liberal_balance_excludeauto <-glm(as.numeric(Liberal) ~ 
                                    + I(setting=="urban")
                                  + I(setting=="rural")
                                  + endowment + enrollment + ranking
                                  + I(region=="North") 
                                  + I(region=="South") 
                                  + I(region=="West") 
                                  + I(real_religion == 1)
                                  + as.factor(num_school_type),
                                  data = exclude_autoreply, 
                                  family = binomial(link = "logit"))

summary(liberal_balance_excludeauto)

# Balance Test Model- Conservative
# Any college characteristics predict being in the Conservative Treatment?
conservative_balance_excludeauto <-glm(as.numeric(Conservative) ~ 
                                         + I(setting=="urban")
                                       + I(setting=="rural")
                                       + endowment + enrollment + ranking
                                       + I(region=="North") 
                                       + I(region=="South") 
                                       + I(region=="West") 
                                       + I(real_religion == 1)
                                       + as.factor(num_school_type),
                                       data = exclude_autoreply, 
                                       family = binomial(link = "logit"))

summary(conservative_balance_excludeauto)

# Balance Test Model- Control
# Any college characteristics predict being in the Control Condition?
control_balance_excludeauto <-glm(as.numeric(Control) ~ I(setting=="urban")
                                  + I(setting=="rural")
                                  + endowment + enrollment + ranking
                                  + I(region=="North") 
                                  + I(region=="South") 
                                  + I(region=="West") 
                                  + I(real_religion == 1)
                                  + as.factor(num_school_type),
                                  data = exclude_autoreply, 
                                  family = binomial(link = "logit"))

summary(control_balance_excludeauto)

# Balance Test/ Equivalency Check Tables- autoreplies and undeliverables excluded
# Liberal- autoreplies and undeliverables excluded
library(Hmisc)
Variables <- matrix(NA, 13 ,3)
colnames(Variables) <- c("Coefficient", "Std. Error", "p-value")
rownames(Variables) <- c("Intercept","urban","rural", "endowment", "enrollment", 
                         "ranking", "North", "South", "West",
                         "religious", "National Liberal Arts",
                         "Regional Universities", "Regional Colleges") 
Variables[ ,1] <- round(as.numeric(liberal_balance_excludeauto$coefficients), digits = 2)
Variables[ ,2] <- round(summary(liberal_balance_excludeauto)$coefficients[ ,2], digits = 2)
Variables[ ,3] <- round(summary(liberal_balance_excludeauto)$coefficients[ ,4], digits = 2)
latex(Variables, file = "")

# Balance Test/ Equivalency Check Tables- autoreplies and undeliverables excluded
# Conservative- autoreplies and undeliverables excluded
library(Hmisc)
Variables <- matrix(NA, 13 ,3)
colnames(Variables) <- c("Coefficient", "Std. Error", "p-value")
rownames(Variables) <- c("Intercept","urban","rural", "endowment", "enrollment", 
                         "ranking", "North", "South", "West",
                         "religious", "National Liberal Arts",
                         "Regional Universities", "Regional Colleges") 
Variables[ ,1] <- round(as.numeric(conservative_balance_excludeauto$coefficients), digits = 2)
Variables[ ,2] <- round(summary(conservative_balance_excludeauto)$coefficients[ ,2], digits = 2)
Variables[ ,3] <- round(summary(conservative_balance_excludeauto)$coefficients[ ,4], digits = 2)
latex(Variables, file = "")

# Balance Test/ Equivalency Check Tables-autoreplies and undeliverables excluded
# Control- All Emails Sent-autoreplies and undeliverables excluded 
library(Hmisc)
Variables <- matrix(NA, 13 ,3)
colnames(Variables) <- c("Coefficient", "Std. Error", "p-value")
rownames(Variables) <- c("Intercept","urban","rural", "endowment", "enrollment", 
                         "ranking", "North", "South", "West",
                         "religious", "National Liberal Arts",
                         "Regional Universities", "Regional Colleges") 
Variables[ ,1] <- round(as.numeric(control_balance_excludeauto$coefficients), digits = 2)
Variables[ ,2] <- round(summary(control_balance_excludeauto)$coefficients[ ,2], digits = 2)
Variables[ ,3] <- round(summary(control_balance_excludeauto)$coefficients[ ,4], digits = 2)
latex(Variables, file = "")

# Analysis Overall Sample ---------------------------------------------------------------
# Difference of Means tests
# Splitting Data by condition
Control_dataset_room <- roomdata_rand[roomdata_rand$condition == "Control", ]
Liberal_dataset_room <- roomdata_rand[roomdata_rand$condition == "Liberal", ]
Conservative_dataset_room <- roomdata_rand[roomdata_rand$condition == "Conservative", ]

# Reply at All
# Liberal-Control Difference of Means- Overall
q <- na.omit(Liberal_dataset_room$reply)
p <- na.omit(Control_dataset_room$reply)
Liberal_Control_DoM_test_reply_Room <- t.test(q, p)
Liberal_Control_DoM_reply_Room  <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Liberal_Control_DoM_CI_reply_Room  <- round(Liberal_Control_DoM_test_reply_Room$conf.int, digits = 2) 
Liberal_Control_DoM_T_reply_Room  <- round(Liberal_Control_DoM_test_reply_Room$statistic, digits = 2)
Liberal_Control_DoM_p_reply_Room  <- round(Liberal_Control_DoM_test_reply_Room$p.value, digits = 2)
Liberal_Control_DoM_n_reply_Room  <- length(p) + length(q)

# Conservative-Control Difference of Means
q <- na.omit(Conservative_dataset_room$reply)
p <- na.omit(Control_dataset_room$reply)
Conservative_Control_DoM_test_reply_Room  <- t.test(q, p)
Conservative_Control_DoM_reply_Room  <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Conservative_Control_DoM_CI_reply_Room  <- round(Conservative_Control_DoM_test_reply_Room$conf.int, digits = 2) 
Conservative_Control_DoM_T_reply_Room  <- round(Conservative_Control_DoM_test_reply_Room$statistic, digits = 2)
Conservative_Control_DoM_p_reply_Room  <- round(Conservative_Control_DoM_test_reply_Room$p.value, digits = 2)
Conservative_Control_DoM_n_reply_Room  <- length(p) + length(q)

# Liberal-Conservative Difference of Means
q <- na.omit(Liberal_dataset_room$reply)
p <- na.omit(Conservative_dataset_room$reply)
Liberal_Conservative_DoM_test_reply_Room  <- t.test(q, p)
Liberal_Conservative_DoM_reply_Room  <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Liberal_Conservative_DoM_CI_reply_Room  <- round(Liberal_Conservative_DoM_test_reply_Room$conf.int, digits = 2) 
Liberal_Conservative_DoM_T_reply_Room  <- round(Liberal_Conservative_DoM_test_reply_Room$statistic, digits = 2)
Liberal_Conservative_DoM_p_reply_Room  <- round(Liberal_Conservative_DoM_test_reply_Room$p.value, digits = 2)
Liberal_Conservative_DoM_n_reply_Room  <- length(p) + length(q)

# Substantive Replies
# Liberal-Control Difference of Means- Overall
q <- na.omit(Liberal_dataset_room$substantive)
p <- na.omit(Control_dataset_room$substantive)
Liberal_Control_DoM_test_substantive_Room <- t.test(q, p)
Liberal_Control_DoM_substantive_Room <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Liberal_Control_DoM_CI_substantive_Room <- round(Liberal_Control_DoM_test_reply_Room$conf.int, digits = 2) 
Liberal_Control_DoM_T_substantive_Room <- round(Liberal_Control_DoM_test_reply_Room$statistic, digits = 2)
Liberal_Control_DoM_p_substantive_Room <- round(Liberal_Control_DoM_test_reply_Room$p.value, digits = 2)
Liberal_Control_DoM_n_substantive_Room <- length(p) + length(q)

# Conservative-Control Difference of Means
q <- na.omit(Conservative_dataset_room$substantive)
p <- na.omit(Control_dataset_room$substantive)
Conservative_Control_DoM_test_substantive_Room <- t.test(q, p)
Conservative_Control_DoM_substantive_Room <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Conservative_Control_DoM_CI_substantive_Room <- round(Conservative_Control_DoM_test_reply_Room$conf.int, digits = 2) 
Conservative_Control_DoM_T_substantive_Room <- round(Conservative_Control_DoM_test_reply_Room$statistic, digits = 2)
Conservative_Control_DoM_p_substantive_Room <- round(Conservative_Control_DoM_test_reply_Room$p.value, digits = 2)
Conservative_Control_DoM_n_substantive_Room <- length(p) + length(q)

# Liberal-Conservative Difference of Means
q <- na.omit(Liberal_dataset_room$substantive)
p <- na.omit(Conservative_dataset_room$substantive)
Liberal_Conservative_DoM_test_substantive_Room <- t.test(q, p)
Liberal_Conservative_DoM_substantive_Room <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Liberal_Conservative_DoM_CI_substantive_Room <- round(Liberal_Conservative_DoM_test_reply_Room$conf.int, digits = 2) 
Liberal_Conservative_DoM_T_substantive_Room <- round(Liberal_Conservative_DoM_test_reply_Room$statistic, digits = 2)
Liberal_Conservative_DoM_p_substantive_Room <- round(Liberal_Conservative_DoM_test_reply_Room$p.value, digits = 2)
Liberal_Conservative_DoM_n_substantive_Room <- length(p) + length(q)

# Number of Days to Reply
# Liberal-Control Difference of Means- Overall
q <- na.omit(Liberal_dataset_room$days)
p <- na.omit(Control_dataset_room$days)
Liberal_Control_DoM_test_days_Room <- t.test(q, p)
Liberal_Control_DoM_days_Room <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Liberal_Control_DoM_CI_days_Room <- round(Liberal_Control_DoM_test_reply_Room$conf.int, digits = 2) 
Liberal_Control_DoM_T_days_Room <- round(Liberal_Control_DoM_test_reply_Room$statistic, digits = 2)
Liberal_Control_DoM_p_days_Room <- round(Liberal_Control_DoM_test_reply_Room$p.value, digits = 2)
Liberal_Control_DoM_n_days_Room <- length(p) + length(q)

# Conservative-Control Difference of Means
q <- na.omit(Conservative_dataset_room$days)
p <- na.omit(Control_dataset_room$days)
Conservative_Control_DoM_test_days_Room <- t.test(q, p)
Conservative_Control_DoM_days_Room <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Conservative_Control_DoM_CI_days_Room <- round(Conservative_Control_DoM_test_reply_Room$conf.int, digits = 2) 
Conservative_Control_DoM_T_days_Room <- round(Conservative_Control_DoM_test_reply_Room$statistic, digits = 2)
Conservative_Control_DoM_p_days_Room <- round(Conservative_Control_DoM_test_reply_Room$p.value, digits = 2)
Conservative_Control_DoM_n_days_Room <- length(p) + length(q)

# Liberal-Conservative Difference of Means
q <- na.omit(Liberal_dataset_room$days)
p <- na.omit(Conservative_dataset_room$days)
Liberal_Conservative_DoM_test_days_Room <- t.test(q, p)
Liberal_Conservative_DoM_days_Room <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Liberal_Conservative_DoM_CI_days_Room <- round(Liberal_Conservative_DoM_test_reply_Room$conf.int, digits = 2) 
Liberal_Conservative_DoM_T_days_Room <- round(Liberal_Conservative_DoM_test_reply_Room$statistic, digits = 2)
Liberal_Conservative_DoM_p_days_Room <- round(Liberal_Conservative_DoM_test_reply_Room$p.value, digits = 2)
Liberal_Conservative_DoM_n_days_Room <- length(p) + length(q)

# Creating a New Dataset of Only Valid Replies
valid_replies <- roomdata_rand[roomdata_rand$reply == "1", ]

valid_Control_dataset <- valid_replies[valid_replies$condition == "Control", ]
valid_Liberal_dataset <- valid_replies[valid_replies$condition == "Liberal", ]
valid_Conservative_dataset <- valid_replies[valid_replies$condition == "Conservative", ]

# Difference of Means for Emails that Received A Reply at all
# Substantive Replies
# Liberal-Control Substantive Replies, Replied at all
q <- na.omit(valid_Liberal_dataset$substantive)
p <- na.omit(valid_Control_dataset$substantive)
Liberal_Control_DoM_test <- t.test(as.numeric(q),as.numeric(p))

# Conservative-Control Substantive Replies, Replied at all
q <- na.omit(valid_Conservative_dataset$substantive)
p <- na.omit(valid_Control_dataset$substantive)
Conservative_Control_DoM_test <- t.test(as.numeric(q),as.numeric(p))

# Liberal-Conservative Substantive Replies, Replied at all
q <- na.omit(valid_Conservative_dataset$substantive)
p <- na.omit(valid_Liberal_dataset$substantive)
Conservative_Liberal_DoM_test <- t.test(as.numeric(q),as.numeric(p))

# Days to Reply
# Liberal-Control Days to Reply, Replied at all
q <- na.omit(valid_Liberal_dataset$days)
p <- na.omit(valid_Control_dataset$days)
Liberal_Control_DoM_test <- t.test(as.numeric(q),as.numeric(p))

# Conservative-Control Days to Reply, Replied at all
q <- na.omit(valid_Conservative_dataset$days)
p <- na.omit(valid_Control_dataset$days)
Conservative_Control_DoM_test <- t.test(as.numeric(q),as.numeric(p))

# Liberal-Conservative Days to Reply, Replied at all
q <- na.omit(valid_Conservative_dataset$days)
p <- na.omit(valid_Liberal_dataset$days)
Conservative_Liberal_DoM_test <- t.test(as.numeric(q),as.numeric(p))

# Difference of Means Table 
# Creating Vectors of sample sizes, Diff Means, Conf Intervals, T Stats, p-values
dom_n_Room <- c(Liberal_Control_DoM_n_reply_Room, 
                 Conservative_Control_DoM_n_reply_Room, 
                 Liberal_Conservative_DoM_n_reply_Room,
                 
                 Liberal_Control_DoM_n_substantive_Room, 
                 Conservative_Control_DoM_n_substantive_Room, 
                 Liberal_Conservative_DoM_n_substantive_Room,
                 
                 Liberal_Control_DoM_n_days_Room, 
                 Conservative_Control_DoM_n_days_Room, 
                 Liberal_Conservative_DoM_n_days_Room )

differences_of_means_Room <- c(Liberal_Control_DoM_reply_Room,
                                Conservative_Control_DoM_reply_Room,
                                Liberal_Conservative_DoM_reply_Room,
                                
                                Liberal_Control_DoM_substantive_Room,
                                Conservative_Control_DoM_substantive_Room,
                                Liberal_Conservative_DoM_substantive_Room,
                                
                                Liberal_Control_DoM_days_Room,
                                Conservative_Control_DoM_days_Room,
                                Liberal_Conservative_DoM_days_Room)

dom_confidence_intervals_low_Room <- c(round(Liberal_Control_DoM_test_reply_Room$conf.int[1], digits =2),
                                        round(Conservative_Control_DoM_test_reply_Room$conf.int[1], digits =2), 
                                        round(Liberal_Conservative_DoM_test_reply_Room$conf.int[1], digits =2),
                                        
                                        round(Liberal_Control_DoM_test_substantive_Room$conf.int[1], digits =2),
                                        round(Conservative_Control_DoM_test_substantive_Room$conf.int[1], digits =2), 
                                        round(Liberal_Conservative_DoM_test_substantive_Room$conf.int[1], digits =2),
                                        
                                        round(Liberal_Control_DoM_test_days_Room$conf.int[1], digits =2),
                                        round(Conservative_Control_DoM_test_days_Room$conf.int[1], digits =2), 
                                        round(Liberal_Conservative_DoM_test_days_Room$conf.int[1], digits =2))



dom_confidence_intervals_high_Room <- c(round(Liberal_Control_DoM_test_reply_Room$conf.int[2], digits =2),
                                         round(Conservative_Control_DoM_test_reply_Room$conf.int[2], digits =2), 
                                         round(Liberal_Conservative_DoM_test_reply_Room$conf.int[2], digits =2),
                                         
                                         round(Liberal_Control_DoM_test_substantive_Room$conf.int[2], digits =2),
                                         round(Conservative_Control_DoM_test_substantive_Room$conf.int[2], digits =2), 
                                         round(Liberal_Conservative_DoM_test_substantive_Room$conf.int[2], digits =2),
                                         
                                         round(Liberal_Control_DoM_test_days_Room$conf.int[2], digits =2),
                                         round(Conservative_Control_DoM_test_days_Room$conf.int[2], digits =2), 
                                         round(Liberal_Conservative_DoM_test_days_Room$conf.int[2], digits =2))

dom_t_statistics_Room <- c(Liberal_Control_DoM_T_reply_Room,
                            Conservative_Control_DoM_T_reply_Room,
                            Liberal_Conservative_DoM_T_reply_Room,
                            
                            Liberal_Control_DoM_T_substantive_Room,
                            Conservative_Control_DoM_T_substantive_Room,
                            Liberal_Conservative_DoM_T_substantive_Room,
                            
                            Liberal_Control_DoM_T_days_Room,
                            Conservative_Control_DoM_T_days_Room,
                            Liberal_Conservative_DoM_T_days_Room)

dom_p_values_Room <- c(Liberal_Control_DoM_p_reply_Room,
                        Conservative_Control_DoM_p_reply_Room,
                        Liberal_Conservative_DoM_p_reply_Room,
                        
                        Liberal_Control_DoM_p_substantive_Room,
                        Conservative_Control_DoM_p_substantive_Room,
                        Liberal_Conservative_DoM_p_substantive_Room,
                        
                        Liberal_Control_DoM_p_days_Room,
                        Conservative_Control_DoM_p_days_Room,
                        Liberal_Conservative_DoM_p_days_Room)

# Difference of Means Latex Output Table
# domconfidenceintervals object contains only lower confidence interval bounds
# Insert brackets, commas, and upper confidence interval bounds in Latex manually 
# must adjust size in Latex (scalebox =.85)
library(Hmisc)
Test <- matrix(NA, 9, 5)
colnames(Test) <- c("n", "Diff. Means", "95% CI", 
                    "T-statistic", "p-value")
rownames(Test) <- c("Liberal-Control, Reply at All",
                    "Conservative-Control, Reply at All",
                    "Liberal-Conservative, Reply at All", 
                    
                    "Liberal-Control, Substantive Replies",
                    "Conservative-Control, Substantive Replies",
                    "Liberal-Conservative, Substantive Replies",
                    
                    "Liberal-Control, Days to Reply",
                    "Conservative-Control, Days to Reply",
                    "Liberal-Conservative, Days to Reply") 
Test[ ,1] <- dom_n_Room
Test[ ,2] <- differences_of_means_Room
Test[ ,3] <- dom_confidence_intervals_low_Room
Test[ ,4] <- dom_t_statistics_Room
Test[ ,5] <- dom_p_values_Room
latex(Test, file = "")

# Logit Models for Overall Sample --------------------------------------------------------------------------
# Logistic Regression of Reply at All 
# Logit Model with No Controls
results_room <-glm(as.numeric(reply) ~ 
                          + I(condition=="Liberal")
                        + I(condition=="Conservative"),
                        data = roomdata_rand, 
                        family = binomial(link = "logit"))

summary(results_room)

# Logit Model with Controls, Reply at all 
results_room_controls <-glm(as.numeric(reply) ~ 
                                   + I(condition=="Liberal") 
                                 + I(condition=="Conservative")
                                 + I(setting=="urban")
                                 + I(setting=="rural")
                                 + endowment + enrollment + ranking
                                 + I(south==1)
                                 + I(religious==1)
                                 + trumpvote, data = roomdata_rand, 
                                 family = binomial(link = "logit"))

summary(results_room_controls)

# Logit Model with Controls and Interactions, Reply at All
results_room_interactions <-glm(as.numeric(reply) ~ 
                           + I(condition=="Liberal") 
                         + I(condition=="Conservative")
                         + I(setting=="urban")
                         + I(setting=="rural")
                         + endowment + enrollment + ranking
                         + I(south==1)
                         + I(religious==1)
                         + trumpvote
                         + trumpvote * I(condition=="Liberal")
                         + trumpvote * I(condition=="Conservative"),
                         data = roomdata_rand, family = binomial(link = "logit"))

summary(results_room_interactions)

# Reply at All Logit Regression table
library("stargazer")
reply_at_all_room_logit_table <- stargazer(results_room, results_room_controls, 
                                         results_room_interactions,
                                         covariate.labels = c("Liberal Condition", 
                                                              "Conservative Condition",
                                                              "Urban Setting",
                                                              "Rural Setting",
                                                              "Endowment",
                                                              "Enrollment",
                                                              "Ranking",
                                                              "Southern",
                                                              "Religious",
                                                              "Trump Vote",
                                                              "Trump Vote * Liberal Condition",
                                                              "Trump Vote * Conservative Condition"),
                                         dep.var.labels = "Reply at All",
                                         star.cutoffs = c(.05, .01, NA),
                                         #star.char    = c("*", "**", ""),         
                                         notes.append     = FALSE,
                                         notes            = "*$p<0.05$; **$p<0.01$")

# Substantive Logit Model with No Controls
room_substantive <-glm(as.numeric(substantive) ~ 
                     + I(condition=="Liberal")
                   + I(condition=="Conservative"),
                   data = roomdata_rand, 
                   family = binomial(link = "logit"))

summary(room_substantive)

# Logit Model with Controls 
room_controls_substantive <-glm(as.numeric(substantive) ~ 
                              + I(condition=="Liberal") 
                            + I(condition=="Conservative")
                            + I(setting=="urban")
                            + I(setting=="rural")
                            + endowment + enrollment + ranking
                            + I(south==1)
                            + I(religious==1)
                            + trumpvote, data = roomdata_rand, 
                            family = binomial(link = "logit"))

summary(room_controls_substantive)

# Logit Model with Controls and Interactions
room_interactions_substantive <-glm(as.numeric(substantive) ~ 
                                  + I(condition=="Liberal") 
                                + I(condition=="Conservative")
                                + I(setting=="urban")
                                + I(setting=="rural")
                                + endowment + enrollment + ranking
                                + I(south==1)
                                + I(religious==1)
                                + trumpvote
                                + trumpvote * I(condition=="Liberal")
                                + trumpvote * I(condition=="Conservative"),
                                data = roomdata_rand, family = binomial(link = "logit"))

summary(room_interactions_substantive)

# Substantive Reply Logit Regression table
library("stargazer")

substantive_room_logit_table <- stargazer(room_substantive, 
                                          room_controls_substantive,
                                          room_interactions_substantive,
                                          covariate.labels = c("Liberal Condition", 
                                                                "Conservative Condition",
                                                                "Urban Setting",
                                                                "Rural Setting",
                                                                "Endowment",
                                                                "Enrollment",
                                                                "Ranking",
                                                                "Southern",
                                                                "Religious",
                                                                "Trump Vote",
                                                               "Trump Vote * Liberal Condition",
                                                               "Trump Vote * Conservative Condition"),
                                           dep.var.labels = "Substantive Reply",
                                          star.cutoffs = c(.05, .01, NA),
                                          #star.char    = c("*", "**", ""),         
                                          notes.append     = FALSE,
                                          notes            = "*$p<0.05$; **$p<0.01$")

# OLS Models Overall Sample
# OLS Model with No Controls
OLS_results_room <-lm(as.numeric(reply) ~ 
                             + I(condition=="Liberal")
                           + I(condition=="Conservative"),
                           data = roomdata_rand)

summary(OLS_results_room)

# OLS Model with Controls 
OLS_results_room_controls <-lm(as.numeric(reply) ~ 
                                      + I(condition=="Liberal") 
                                    + I(condition=="Conservative")
                                    + I(setting=="urban")
                                    + I(setting=="rural")
                                    + endowment + enrollment + ranking
                                    + I(south==1)
                                    + I(religious==1)
                                    + as.factor(num_school_type),
                                    data = roomdata_rand)

summary(OLS_results_room_controls)

# OLS Models Overall Sample-Days to Reply
# OLS Model with No Controls
room_days <-lm(as.numeric(days) ~ 
                        + I(condition=="Liberal")
                      + I(condition=="Conservative"),
                      data = roomdata_rand)

summary(room_days)

# OLS Model with Controls 
room_days_controls <-lm(as.numeric(days) ~ 
                                 + I(condition=="Liberal") 
                               + I(condition=="Conservative")
                               + I(setting=="urban")
                               + I(setting=="rural")
                               + endowment + enrollment + ranking
                               + I(south==1)
                               + I(religious==1)
                               + trumpvote,
                               data = roomdata_rand)

summary(room_days_controls)

# Logit Model with Controls and Interactions
room_days_interactions<- lm(as.numeric(days) ~ 
                                      + I(condition=="Liberal") 
                                    + I(condition=="Conservative")
                                    + I(setting=="urban")
                                    + I(setting=="rural")
                                    + endowment + enrollment + ranking
                                    + I(south==1)
                                    + I(religious==1)
                                    + trumpvote
                                    + trumpvote * I(condition=="Liberal")
                                    + trumpvote * I(condition=="Conservative"),
                                    data = roomdata_rand)

summary(room_days_interactions)

# Days to Reply OLS Regression table
library("stargazer")

# Renaming Models Shorter to go in stargazer
r <- results_room
r_c <- results_room_controls
s <- room_substantive
s_c <- room_controls_substantive
d <- room_days
d_c <- room_days_controls

Table_Two <- stargazer(r, r_c, s, s_c, d, d_c,
                       covariate.labels = c("Liberal Condition", 
                                            "Conservative Condition",
                                            "Urban Setting",
                                            "Rural Setting",
                                            "Endowment",
                                            "Enrollment",
                                            "Ranking",
                                            "Southern",
                                            "Religious",
                                            "Trump Vote"),
                       dep.var.labels = c("Reply at All", 
                                          "Substantive Reply", "Days to Reply"),
                       star.cutoffs = c(.05, .01, NA),
                       #star.char    = c("*", "**", ""),         
                       notes.append     = FALSE,
                       notes            = "*$p<0.05$; **$p<0.01$")

# renaming models shorter 
x <- results_room_interactions
y <- room_interactions_substantive 
z<- room_days_interactions

# Table F2 in Appendix
Table_F2 <- stargazer(x,y,z,
                      covariate.labels = c("Liberal Condition", 
                                           "Conservative Condition",
                                           "Urban Setting",
                                           "Rural Setting",
                                           "Endowment",
                                           "Enrollment",
                                           "Ranking",
                                           "Southern",
                                           "Religious",
                                           "Trump Vote",
                                           "Trump Vote * Liberal Condition",
                                           "Trump Vote * Conservative Condition"),
                      dep.var.labels = c("Reply at All",
                                         "Substantive Reply",
                                         "Days to Reply"),
                      star.cutoffs = c(.05, .01, NA),
                      #star.char    = c("*", "**", ""),         
                      notes.append     = FALSE,
                      notes            = "*$p<0.05$; **$p<0.01$")


days_room_days_OLS_table<- stargazer(room_days, 
                                    room_days_controls,
                                    room_days_interactions,
                                   covariate.labels = c("Liberal Condition", 
                                                "Conservative Condition",
                                               "Urban Setting",
                                                "Rural Setting",
                                                "Endowment",
                                                "Enrollment",
                                                 "Ranking",
                                                 "Southern",
                                                  "Religious",
                                               "Trump Vote",
                                               "Trump Vote * Liberal Condition",
                                              "Trump Vote * Conservative Condition"),
                                          dep.var.labels = "Days to Reply",
                                               star.cutoffs = c(.05, .01, NA),
                                               #star.char    = c("*", "**", ""),         
                                               notes.append     = FALSE,
                                               notes            = "*$p<0.05$; **$p<0.01$")

# Testing for Multicollinearity with Variance Inflation Factor
install.packages("car")
library(car)
vif_replies_room <- vif(results_room_controls)
vif_substantive_room <- vif(room_controls_substantive)
vif_days_room <- vif(room_days_controls)

# Marginal Standardization
install.packages("risks")
library(risks)
install.packages("crayon")
library(crayon)

replies_margstd <- riskdiff(formula = substantive ~  
                              condition
                            + I(setting=="urban")
                            + I(setting=="rural")
                            + endowment + enrollment + ranking
                            + I(south==1)
                            + I(religious==1)
                            + trumpvote, 
                            data = roomdata_rand, 
                            approach = "margstd_delta")
summary(replies_margstd)

replies_margstd <- riskdiff(formula = reply ~  
                              condition
                            + I(setting=="urban")
                            + I(setting=="rural")
                            + endowment + enrollment + ranking
                            + I(south==1)
                            + I(religious==1)
                            + trumpvote
                            + trumpvote * I(condition=="Liberal")
                            + trumpvote * I(condition=="Conservative"), 
                            data = roomdata_rand, 
                            approach = "margstd_delta")
summary(replies_margstd)

substantive_margstd <- riskdiff(formula = substantive ~  
                                  condition
                                + I(setting=="urban")
                                + I(setting=="rural")
                                + endowment + enrollment + ranking
                                + I(south==1)
                                + I(religious==1)
                                + trumpvote
                                + trumpvote * I(condition=="Liberal")
                                + trumpvote * I(condition=="Conservative"), 
                                data = roomdata_rand, 
                                approach = "margstd_delta")
summary(substantive_margstd)


# Cox Proportional Hazard Model for Right-Censoring, Days to Reply
library("survival")
room_hazard <- coxph(Surv(days, reply) ~  
                        I(condition=="Liberal") 
                      + I(condition=="Conservative"),
                      data = roomdata_rand)

summary(room_hazard)

library("stargazer")
room_hazard_table <- stargazer(room_hazard, align=TRUE, 
                                        covariate.labels = c("Liberal Condition", 
                                                             "Conservative Condition"),
                                        dep.var.labels   = "Days to Reply",
                                        type="text", apply.coef = exp, p.auto = FALSE, 
                                        t.auto = FALSE, digits = 3, report=('vc*p'))

# Two-Stage Heckman Selection Model, Days to Reply (Fix Variable Labels in Latex)
library("sampleSelection")
two_stage_selection_room = selection(reply ~ I(condition=="Liberal") 
                                + I(condition=="Conservative") + enrollment,
                                days ~ I(condition=="Liberal") 
                                + I(condition=="Conservative"),
                                data = roomdata_rand,
                                method = '2step')

summary(two_stage_selection_room)

# Selection Model Output Table
selection_table_room <- stargazer(two_stage_selection_room)

# Table of Logit Models of Responsiveness, Overall Sample
library(stargazer)
room_logit_table <- stargazer(results_room, results_room_controls,
                                   title = "Logistic Regression Results",
                                   dep.var.labels=c("Responsiveness","Responsiveness"),
                                   covariate.labels=c("Liberal", "Conservative", "Urban", "Rural",
                                                      "Endowment", "Enrollment", "Ranking", "South",
                                                      "Religious", "Liberal Arts", "Regional Universities",
                                                      "Regional Colleges"))

# Table of OLS Models of Responsiveness, Overall Sample
library(stargazer)
room_OLS_table <- stargazer(OLS_results_room, OLS_results_room_controls,
                                 title = "OLS Regression Results",
                                 dep.var.labels=c("Responsiveness","Responsiveness"),
                                 covariate.labels=c("Liberal", "Conservative", "Urban", "Rural",
                                                    "Endowment", "Enrollment", "Ranking", "South",
                                                    "Religious", "Liberal Arts", "Regional Universities",
                                                    "Regional Colleges"))
# OLS table, no controls
library(stargazer)
room_OLS_table <- stargazer(OLS_results_room, 
                            title = "OLS Regression Results",
                            dep.var.labels=c("Responsiveness"),
                            covariate.labels=c("Liberal", "Conservative"))

# logit table, no controls
library(stargazer)
room_logit_table <- stargazer(results_room, 
                            title = "Logistic Regression Results",
                            dep.var.labels=c("Responsiveness"),
                            covariate.labels=c("Liberal", "Conservative"))

# Sub-analyses ------------------------------------------------------------------------------------------
# Difference of Means tests
# National Liberal Arts Colleges
# National Liberal Arts Datasets
Liberal_Arts_Colleges_Control_dataset_room <- Control_dataset_room[Control_dataset_room$type == "National Liberal Arts College", ]
Liberal_Arts_Colleges_Conservative_dataset_room <- Conservative_dataset_room[Conservative_dataset_room$type == "National Liberal Arts College", ]
Liberal_Arts_Colleges_Liberal_dataset_room <- Liberal_dataset_room[Liberal_dataset_room$type == "National Liberal Arts College", ]

# Liberal-Control Difference of Means Among National Liberal Arts Colleges
q <- na.omit(Liberal_Arts_Colleges_Liberal_dataset_room$reply)
p <- na.omit(Liberal_Arts_Colleges_Control_dataset_room$reply)
LibArts_Liberal_Control_DoM_test <- t.test(q, p)
LibArts_Liberal_Control_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
LibArts_Liberal_Control_DoM_CI <- round(LibArts_Liberal_Control_DoM_test$conf.int, digits = 2) 
LibArts_Liberal_Control_DoM_T <- round(LibArts_Liberal_Control_DoM_test$statistic, digits = 2)
LibArts_Liberal_Control_DoM_p <- round(LibArts_Liberal_Control_DoM_test$p.value, digits = 2)
LibArts_Liberal_Control_DoM_n <- length(p) + length(q)

# Conservative-Control Difference of Means Among National Liberal Arts Colleges
q <- na.omit(Liberal_Arts_Colleges_Conservative_dataset_room$reply)
p <- na.omit(Liberal_Arts_Colleges_Control_dataset_room$reply)
LibArts_Conservative_Control_DoM_test <- t.test(q, p)
LibArts_Conservative_Control_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
LibArts_Conservative_Control_DoM_CI <- round(LibArts_Conservative_Control_DoM_test$conf.int, digits = 2) 
LibArts_Conservative_Control_DoM_T <- round(LibArts_Conservative_Control_DoM_test$statistic, digits = 2)
LibArts_Conservative_Control_DoM_p <- round(LibArts_Conservative_Control_DoM_test$p.value, digits = 2)
LibArts_Conservative_Control_DoM_n <- length(p) + length(q)

# Liberal-Conservative Difference of Means Among National Liberal Arts Colleges
q <- na.omit(Liberal_Arts_Colleges_Liberal_dataset_room$reply)
p <- na.omit(Liberal_Arts_Colleges_Conservative_dataset_room$reply)
LibArts_Liberal_Conservative_DoM_test <- t.test(q, p)
LibArts_Liberal_Conservative_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
LibArts_Liberal_Conservative_DoM_CI <- round(LibArts_Liberal_Conservative_DoM_test$conf.int, digits = 2) 
LibArts_Liberal_Conservative_DoM_T <- round(LibArts_Liberal_Conservative_DoM_test$statistic, digits = 2)
LibArts_Liberal_Conservative_DoM_p <- round(LibArts_Liberal_Conservative_DoM_test$p.value, digits = 2)
LibArts_Liberal_Conservative_DoM_n <- length(p) + length(q)

# Religious Schools
# Religious Schools Datasets
Religious_Colleges_Control_dataset_room <- Control_dataset_room[Control_dataset_room$religious == 1, ]
Religious_Colleges_Liberal_dataset_room <- Liberal_dataset_room[Liberal_dataset_room$religious == 1, ]
Religious_Colleges_Conservative_dataset_room <- Conservative_dataset_room[Conservative_dataset_room$religious == 1, ]

# Liberal-Control Difference of Means Among Religious Schools
q <- na.omit(Religious_Colleges_Liberal_dataset_room$reply)
p <- na.omit(Religious_Colleges_Control_dataset_room$reply)
Religious_Liberal_Control_DoM_test <- t.test(q, p)
Religious_Liberal_Control_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Religious_Liberal_Control_DoM_CI <- round(Religious_Liberal_Control_DoM_test$conf.int, digits = 2) 
Religious_Liberal_Control_DoM_T <- round(Religious_Liberal_Control_DoM_test$statistic, digits = 2)
Religious_Liberal_Control_DoM_p <- round(Religious_Liberal_Control_DoM_test$p.value, digits = 2)
Religious_Liberal_Control_DoM_n <- length(p) + length(q)

# Conservative-Control Difference of Means Among Religious Schools
q <- na.omit(Religious_Colleges_Conservative_dataset_room$reply)
p <- na.omit(Religious_Colleges_Control_dataset_room$reply)
Religious_Conservative_Control_DoM_test <- t.test(q, p)
Religious_Conservative_Control_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Religious_Conservative_Control_DoM_CI <- round(Religious_Conservative_Control_DoM_test$conf.int, digits = 2) 
Religious_Conservative_Control_DoM_T <- round(Religious_Conservative_Control_DoM_test$statistic, digits = 2)
Religious_Conservative_Control_DoM_p <- round(Religious_Conservative_Control_DoM_test$p.value, digits = 2)
Religious_Conservative_Control_DoM_n <- length(p) + length(q)

# Liberal-Conservative Difference of Means Among Religious Schools
q <- na.omit(Religious_Colleges_Liberal_dataset_room$reply)
p <- na.omit(Religious_Colleges_Conservative_dataset_room$reply)
Religious_Liberal_Conservative_DoM_test <- t.test(q, p)
Religious_Liberal_Conservative_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Religious_Liberal_Conservative_DoM_CI <- round(Religious_Liberal_Conservative_DoM_test$conf.int, digits = 2) 
Religious_Liberal_Conservative_DoM_T <- round(Religious_Liberal_Conservative_DoM_test$statistic, digits = 2)
Religious_Liberal_Conservative_DoM_p <- round(Religious_Liberal_Conservative_DoM_test$p.value, digits = 2)
Religious_Liberal_Conservative_DoM_n <- length(p) + length(q)

# Non-Religious Schools
# Non-Religious Schools Datasets
NonReligious_Colleges_Control_dataset_room <- Control_dataset_room[Control_dataset_room$religious == 0, ]
NonReligious_Colleges_Liberal_dataset_room <- Liberal_dataset_room[Liberal_dataset_room$religious == 0, ]
NonReligious_Colleges_Conservative_dataset_room <- Conservative_dataset_room[Conservative_dataset_room$religious == 0, ]

# Liberal-Control Difference of Means Among Religious Schools
q <- na.omit(NonReligious_Colleges_Liberal_dataset_room$reply)
p <- na.omit(NonReligious_Colleges_Control_dataset_room$reply)
NonReligious_Liberal_Control_DoM_test <- t.test(q, p)
NonReligious_Liberal_Control_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
NonReligious_Liberal_Control_DoM_CI <- round(NonReligious_Liberal_Control_DoM_test$conf.int, digits = 2) 
NonReligious_Liberal_Control_DoM_T <- round(NonReligious_Liberal_Control_DoM_test$statistic, digits = 2)
NonReligious_Liberal_Control_DoM_p <- round(NonReligious_Liberal_Control_DoM_test$p.value, digits = 2)
NonReligious_Liberal_Control_DoM_n <- length(p) + length(q)

# Conservative-Control Difference of Means Among Religious Schools
q <- na.omit(NonReligious_Colleges_Conservative_dataset_room$reply)
p <- na.omit(NonReligious_Colleges_Control_dataset_room$reply)
NonReligious_Conservative_Control_DoM_test <- t.test(q, p)
NonReligious_Conservative_Control_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
NonReligious_Conservative_Control_DoM_CI <- round(NonReligious_Conservative_Control_DoM_test$conf.int, digits = 2) 
NonReligious_Conservative_Control_DoM_T <- round(NonReligious_Conservative_Control_DoM_test$statistic, digits = 2)
NonReligious_Conservative_Control_DoM_p <- round(NonReligious_Conservative_Control_DoM_test$p.value, digits = 2)
NonReligious_Conservative_Control_DoM_n <- length(p) + length(q)

# Liberal-Conservative Difference of Means Among Religious Schools
q <- na.omit(NonReligious_Colleges_Liberal_dataset_room$reply)
p <- na.omit(NonReligious_Colleges_Conservative_dataset_room$reply)
NonReligious_Liberal_Conservative_DoM_test <- t.test(q, p)
NonReligious_Liberal_Conservative_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
NonReligious_Liberal_Conservative_DoM_CI <- round(NonReligious_Liberal_Conservative_DoM_test$conf.int, digits = 2) 
NonReligious_Liberal_Conservative_DoM_T <- round(NonReligious_Liberal_Conservative_DoM_test$statistic, digits = 2)
NonReligious_Liberal_Conservative_DoM_p <- round(NonReligious_Liberal_Conservative_DoM_test$p.value, digits = 2)
NonReligious_Liberal_Conservative_DoM_n <- length(p) + length(q)

# Southern Schools
# Southern Schools Datasets
Southern_Control_dataset_room <- Control_dataset_room[Control_dataset_room$region == "South", ]
Southern_Liberal_dataset_room <- Liberal_dataset_room[Liberal_dataset_room$region == "South", ]
Southern_Conservative_dataset_room <- Conservative_dataset_room[Conservative_dataset_room$region == "South", ]

# Liberal-Control Difference of Means Among Southern Schools
q <- na.omit(Southern_Liberal_dataset_room$reply)
p <- na.omit(Southern_Control_dataset_room$reply)
Southern_Liberal_Control_DoM_test <- t.test(q, p)
Southern_Liberal_Control_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Southern_Liberal_Control_DoM_CI <- round(Southern_Liberal_Control_DoM_test$conf.int, digits = 2) 
Southern_Liberal_Control_DoM_T <- round(Southern_Liberal_Control_DoM_test$statistic, digits = 2)
Southern_Liberal_Control_DoM_p <- round(Southern_Liberal_Control_DoM_test$p.value, digits = 2)
Southern_Liberal_Control_DoM_n <- length(p) + length(q)

# Conservative-Control Difference of Means Among Southern Schools
q <- na.omit(Southern_Conservative_dataset_room$reply)
p <- na.omit(Southern_Control_dataset_room$reply)
Southern_Conservative_Control_DoM_test <- t.test(q, p)
Southern_Conservative_Control_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Southern_Conservative_Control_DoM_CI <- round(Southern_Conservative_Control_DoM_test$conf.int, digits = 2) 
Southern_Conservative_Control_DoM_T <- round(Southern_Conservative_Control_DoM_test$statistic, digits = 2)
Southern_Conservative_Control_DoM_p <- round(Southern_Conservative_Control_DoM_test$p.value, digits = 2)
Southern_Conservative_Control_DoM_n <- length(p) + length(q)

# Liberal-Conservative Difference of Means Among Southern Schools
q <- na.omit(Southern_Liberal_dataset_room$reply)
p <- na.omit(Southern_Conservative_dataset_room$reply)
Southern_Liberal_Conservative_DoM_test <- t.test(q, p)
Southern_Liberal_Conservative_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Southern_Liberal_Conservative_DoM_CI <- round(Southern_Liberal_Conservative_DoM_test$conf.int, digits = 2) 
Southern_Liberal_Conservative_DoM_T <- round(Southern_Liberal_Conservative_DoM_test$statistic, digits = 2)
Southern_Liberal_Conservative_DoM_p <- round(Southern_Liberal_Conservative_DoM_test$p.value, digits = 2)
Southern_Liberal_Conservative_DoM_n <- length(p) + length(q)

# NonSouthern Schools
# NonSouthern Schools Datasets
NonSouthern_Control_dataset_room <- Control_dataset_room[Control_dataset_room$region != "South", ]
NonSouthern_Liberal_dataset_room <- Liberal_dataset_room[Liberal_dataset_room$region != "South", ]
NonSouthern_Conservative_dataset_room <- Conservative_dataset_room[Conservative_dataset_room$region != "South", ]

# Liberal-Control Difference of Means Among NonSouthern Schools
q <- na.omit(NonSouthern_Liberal_dataset_room$reply)
p <- na.omit(NonSouthern_Control_dataset_room$reply)
NonSouthern_Liberal_Control_DoM_test <- t.test(q, p)
NonSouthern_Liberal_Control_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
NonSouthern_Liberal_Control_DoM_CI <- round(NonSouthern_Liberal_Control_DoM_test$conf.int, digits = 2) 
NonSouthern_Liberal_Control_DoM_T <- round(NonSouthern_Liberal_Control_DoM_test$statistic, digits = 2)
NonSouthern_Liberal_Control_DoM_p <- round(NonSouthern_Liberal_Control_DoM_test$p.value, digits = 2)
NonSouthern_Liberal_Control_DoM_n <- length(p) + length(q)

# Conservative-Control Difference of Means Among NonSouthern Schools
q <- na.omit(NonSouthern_Conservative_dataset_room$reply)
p <- na.omit(NonSouthern_Control_dataset_room$reply)
NonSouthern_Conservative_Control_DoM_test <- t.test(q, p)
NonSouthern_Conservative_Control_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
NonSouthern_Conservative_Control_DoM_CI <- round(NonSouthern_Conservative_Control_DoM_test$conf.int, digits = 2) 
NonSouthern_Conservative_Control_DoM_T <- round(NonSouthern_Conservative_Control_DoM_test$statistic, digits = 2)
NonSouthern_Conservative_Control_DoM_p <- round(NonSouthern_Conservative_Control_DoM_test$p.value, digits = 2)
NonSouthern_Conservative_Control_DoM_n <- length(p) + length(q)

# Liberal-Conservative Difference of Means Among NonSouthern Schools
q <- na.omit(NonSouthern_Liberal_dataset_room$reply)
p <- na.omit(NonSouthern_Conservative_dataset_room$reply)
NonSouthern_Liberal_Conservative_DoM_test <- t.test(q, p)
NonSouthern_Liberal_Conservative_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
NonSouthern_Liberal_Conservative_DoM_CI <- round(NonSouthern_Liberal_Conservative_DoM_test$conf.int, digits = 2) 
NonSouthern_Liberal_Conservative_DoM_T <- round(NonSouthern_Liberal_Conservative_DoM_test$statistic, digits = 2)
NonSouthern_Liberal_Conservative_DoM_p <- round(NonSouthern_Liberal_Conservative_DoM_test$p.value, digits = 2)
NonSouthern_Liberal_Conservative_DoM_n <- length(p) + length(q)

# Urban Schools
# Urban Schools Datasets
Urban_Control_dataset_room <- Control_dataset_room[Control_dataset_room$setting == "urban", ]
Urban_Liberal_dataset_room <- Liberal_dataset_room[Liberal_dataset_room$setting == "urban", ]
Urban_Conservative_dataset_room <- Conservative_dataset_room[Conservative_dataset_room$setting == "urban", ]

# Liberal-Control Difference of Means Among Urban Schools
q <- na.omit(Urban_Liberal_dataset_room$reply)
p <- na.omit(Urban_Control_dataset_room$reply)
Urban_Liberal_Control_DoM_test <- t.test(q, p)
Urban_Liberal_Control_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Urban_Liberal_Control_DoM_CI <- round(Urban_Liberal_Control_DoM_test$conf.int, digits = 2) 
Urban_Liberal_Control_DoM_T <- round(Urban_Liberal_Control_DoM_test$statistic, digits = 2)
Urban_Liberal_Control_DoM_p <- round(Urban_Liberal_Control_DoM_test$p.value, digits = 2)
Urban_Liberal_Control_DoM_n <- length(p) + length(q)

# Conservative-Control Difference of Means Among Urban Schools
q <- na.omit(Urban_Conservative_dataset_room$reply)
p <- na.omit(Urban_Control_dataset_room$reply)
Urban_Conservative_Control_DoM_test <- t.test(q, p)
Urban_Conservative_Control_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Urban_Conservative_Control_DoM_CI <- round(Urban_Conservative_Control_DoM_test$conf.int, digits = 2) 
Urban_Conservative_Control_DoM_T <- round(Urban_Conservative_Control_DoM_test$statistic, digits = 2)
Urban_Conservative_Control_DoM_p <- round(Urban_Conservative_Control_DoM_test$p.value, digits = 2)
Urban_Conservative_Control_DoM_n <- length(p) + length(q)

# Liberal-Conservative Difference of Means Among Urban Schools
q <- na.omit(Urban_Liberal_dataset_room$reply)
p <- na.omit(Urban_Conservative_dataset_room$reply)
Urban_Liberal_Conservative_DoM_test <- t.test(q, p)
Urban_Liberal_Conservative_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Urban_Liberal_Conservative_DoM_CI <- round(Urban_Liberal_Conservative_DoM_test$conf.int, digits = 2) 
Urban_Liberal_Conservative_DoM_T <- round(Urban_Liberal_Conservative_DoM_test$statistic, digits = 2)
Urban_Liberal_Conservative_DoM_p <- round(Urban_Liberal_Conservative_DoM_test$p.value, digits = 2)
Urban_Liberal_Conservative_DoM_n <- length(p) + length(q)

# Rural Schools
# Rural Schools Datasets
Rural_Control_dataset_room <- Control_dataset_room[Control_dataset_room$setting == "rural", ]
Rural_Liberal_dataset_room <- Liberal_dataset_room[Liberal_dataset_room$setting == "rural", ]
Rural_Conservative_dataset_room <- Conservative_dataset_room[Conservative_dataset_room$setting == "rural", ]

# Liberal-Control Difference of Means Among Rural Schools
q <- na.omit(Rural_Liberal_dataset_room$reply)
p <- na.omit(Rural_Control_dataset_room$reply)
Rural_Liberal_Control_DoM_test <- t.test(q, p)
Rural_Liberal_Control_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Rural_Liberal_Control_DoM_CI <- round(Rural_Liberal_Control_DoM_test$conf.int, digits = 2) 
Rural_Liberal_Control_DoM_T <- round(Rural_Liberal_Control_DoM_test$statistic, digits = 2)
Rural_Liberal_Control_DoM_p <- round(Rural_Liberal_Control_DoM_test$p.value, digits = 2)
Rural_Liberal_Control_DoM_n <- length(p) + length(q)

# Conservative-Control Difference of Means Among Rural Schools
q <- na.omit(Rural_Conservative_dataset_room$reply)
p <- na.omit(Rural_Control_dataset_room$reply)
Rural_Conservative_Control_DoM_test <- t.test(q, p)
Rural_Conservative_Control_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Rural_Conservative_Control_DoM_CI <- round(Rural_Conservative_Control_DoM_test$conf.int, digits = 2) 
Rural_Conservative_Control_DoM_T <- round(Rural_Conservative_Control_DoM_test$statistic, digits = 2)
Rural_Conservative_Control_DoM_p <- round(Rural_Conservative_Control_DoM_test$p.value, digits = 2)
Rural_Conservative_Control_DoM_n <- length(p) + length(q)

# Liberal-Conservative Difference of Means Among Rural Schools
q <- na.omit(Rural_Liberal_dataset_room$reply)
p <- na.omit(Rural_Conservative_dataset_room$reply)
Rural_Liberal_Conservative_DoM_test <- t.test(q, p)
Rural_Liberal_Conservative_DoM <- round(mean(as.numeric(q))- mean(as.numeric(p)), digits = 2)
Rural_Liberal_Conservative_DoM_CI <- round(Rural_Liberal_Conservative_DoM_test$conf.int, digits = 2) 
Rural_Liberal_Conservative_DoM_T <- round(Rural_Liberal_Conservative_DoM_test$statistic, digits = 2)
Rural_Liberal_Conservative_DoM_p <- round(Rural_Liberal_Conservative_DoM_test$p.value, digits = 2)
Rural_Liberal_Conservative_DoM_n <- length(p) + length(q)

# Difference of Means Table ----------------------------------------------------------
dom_n <- c(Liberal_Control_DoM_n, Conservative_Control_DoM_n, Liberal_Conservative_DoM_n, 
           LibArts_Liberal_Control_DoM_n, LibArts_Conservative_Control_DoM_n, LibArts_Liberal_Conservative_DoM_n,
           Religious_Liberal_Control_DoM_n,Religious_Conservative_Control_DoM_n, Religious_Liberal_Conservative_DoM_n,
           NonReligious_Liberal_Control_DoM_n, NonReligious_Conservative_Control_DoM_n,
           NonReligious_Liberal_Conservative_DoM_n, Southern_Liberal_Control_DoM_n,
           Southern_Conservative_Control_DoM_n, Southern_Liberal_Conservative_DoM_n,
           NonSouthern_Liberal_Control_DoM_n, NonSouthern_Conservative_Control_DoM_n,
           NonSouthern_Liberal_Conservative_DoM_n, Urban_Liberal_Control_DoM_n,
           Urban_Conservative_Control_DoM_n, Urban_Liberal_Conservative_DoM_n,
           Rural_Liberal_Control_DoM_n, Rural_Conservative_Control_DoM_n,
           Rural_Liberal_Conservative_DoM_n)

differencesofmeans <- c(Liberal_Control_DoM, Conservative_Control_DoM, Liberal_Conservative_DoM,
                        LibArts_Liberal_Control_DoM, LibArts_Conservative_Control_DoM,
                        LibArts_Liberal_Conservative_DoM, Religious_Liberal_Control_DoM,
                        Religious_Conservative_Control_DoM, Religious_Liberal_Conservative_DoM,
                        NonReligious_Liberal_Control_DoM, NonReligious_Conservative_Control_DoM,
                        NonReligious_Liberal_Conservative_DoM, Southern_Liberal_Control_DoM,
                        Southern_Conservative_Control_DoM, Southern_Liberal_Conservative_DoM,
                        NonSouthern_Liberal_Control_DoM, NonSouthern_Conservative_Control_DoM,
                        NonSouthern_Liberal_Conservative_DoM, Urban_Liberal_Control_DoM,
                        Urban_Conservative_Control_DoM, Urban_Liberal_Conservative_DoM,
                        Rural_Liberal_Control_DoM, Rural_Conservative_Control_DoM,
                        Rural_Liberal_Conservative_DoM)

domconfidenceintervalslow <- c(round(Liberal_Control_DoM_test$conf.int[1], digits =2),
                               round(Conservative_Control_DoM_test$conf.int[1], digits =2), 
                               round(Liberal_Conservative_DoM_test$conf.int[1], digits =2),
                               
                               round(LibArts_Liberal_Control_DoM_test$conf.int[1], digits =2),
                               round(LibArts_Conservative_Control_DoM_test$conf.int[1], digits =2),
                               round(LibArts_Liberal_Conservative_DoM_test$conf.int[1], digits =2),
                               
                               round(Religious_Liberal_Control_DoM_test$conf.int[1], digits =2),
                               round(Religious_Conservative_Control_DoM_test$conf.int[1], digits=2),
                               round(Religious_Liberal_Conservative_DoM_test$conf.int[1], digits =2),
                               
                               round(NonReligious_Liberal_Control_DoM_test$conf.int[1], digits =2),
                               round(NonReligious_Conservative_Control_DoM_test$conf.int[1], digits =2),
                               round(NonReligious_Liberal_Conservative_DoM_test$conf.int[1], digits =2),
                               
                               round(Southern_Liberal_Control_DoM_test$conf.int[1], digits =2),
                               round(Southern_Conservative_Control_DoM_test$conf.int[1], digits =2),
                               round(Southern_Liberal_Conservative_DoM_test$conf.int[1], digits =2),
                               
                               round(NonSouthern_Liberal_Control_DoM_test$conf.int[1], digits =2),
                               round(NonSouthern_Conservative_Control_DoM_test$conf.int[1], digits =2),
                               round(NonSouthern_Liberal_Conservative_DoM_test$conf.int[1], digits =2),
                               
                               round(Urban_Liberal_Control_DoM_test$conf.int[1], digits =2),
                               round(Urban_Conservative_Control_DoM_test$conf.int[1], digits =2),
                               round(Urban_Liberal_Conservative_DoM_test$conf.int[1], digits =2),
                               
                               round(Rural_Liberal_Control_DoM_test$conf.int[1], digits =2),
                               round(Rural_Conservative_Control_DoM_test$conf.int[1], digits =2),
                               round(Rural_Liberal_Conservative_DoM_test$conf.int[1], digits =2))

domconfidenceintervalshigh <- c(round(Liberal_Control_DoM_test$conf.int[2], digits =2),
                                round(Conservative_Control_DoM_test$conf.int[2], digits =2), 
                                round(Liberal_Conservative_DoM_test$conf.int[2], digits =2),
                                
                                round(LibArts_Liberal_Control_DoM_test$conf.int[2], digits =2),
                                round(LibArts_Conservative_Control_DoM_test$conf.int[2], digits =2),
                                round(LibArts_Liberal_Conservative_DoM_test$conf.int[2], digits =2),
                                
                                round(Religious_Liberal_Control_DoM_test$conf.int[2], digits =2),
                                round(Religious_Conservative_Control_DoM_test$conf.int[2], digits=2),
                                round(Religious_Liberal_Conservative_DoM_test$conf.int[2], digits =2),
                                
                                round(NonReligious_Liberal_Control_DoM_test$conf.int[2], digits =2),
                                round(NonReligious_Conservative_Control_DoM_test$conf.int[2], digits =2),
                                round(NonReligious_Liberal_Conservative_DoM_test$conf.int[2], digits =2),
                                
                                round(Southern_Liberal_Control_DoM_test$conf.int[2], digits =2),
                                round(Southern_Conservative_Control_DoM_test$conf.int[2], digits =2),
                                round(Southern_Liberal_Conservative_DoM_test$conf.int[2], digits =2),
                                
                                round(NonSouthern_Liberal_Control_DoM_test$conf.int[2], digits =2),
                                round(NonSouthern_Conservative_Control_DoM_test$conf.int[2], digits =2),
                                round(NonSouthern_Liberal_Conservative_DoM_test$conf.int[2], digits =2),
                                
                                round(Urban_Liberal_Control_DoM_test$conf.int[2], digits =2),
                                round(Urban_Conservative_Control_DoM_test$conf.int[2], digits =2),
                                round(Urban_Liberal_Conservative_DoM_test$conf.int[2], digits =2),
                                
                                round(Rural_Liberal_Control_DoM_test$conf.int[2], digits =2),
                                round(Rural_Conservative_Control_DoM_test$conf.int[2], digits =2),
                                round(Rural_Liberal_Conservative_DoM_test$conf.int[2], digits =2))

domtstatistics <- c(Liberal_Control_DoM_T, Conservative_Control_DoM_T, Liberal_Conservative_DoM_T,
                    LibArts_Liberal_Control_DoM_T, LibArts_Conservative_Control_DoM_T,
                    LibArts_Liberal_Conservative_DoM_T, Religious_Liberal_Control_DoM_T,
                    Religious_Conservative_Control_DoM_T, Religious_Liberal_Conservative_DoM_T,
                    NonReligious_Liberal_Control_DoM_T, NonReligious_Conservative_Control_DoM_T,
                    NonReligious_Liberal_Conservative_DoM_T, Southern_Liberal_Control_DoM_T,
                    Southern_Conservative_Control_DoM_T, Southern_Liberal_Conservative_DoM_T,
                    NonSouthern_Liberal_Control_DoM_T, NonSouthern_Conservative_Control_DoM_T,
                    NonSouthern_Liberal_Conservative_DoM_T, Urban_Liberal_Control_DoM_T,
                    Urban_Conservative_Control_DoM_T, Urban_Liberal_Conservative_DoM_T,
                    Rural_Liberal_Control_DoM_T, Rural_Conservative_Control_DoM_T,
                    Rural_Liberal_Conservative_DoM_T)

dompvalues <- c(Liberal_Control_DoM_p, Conservative_Control_DoM_p, Liberal_Conservative_DoM_p,
                LibArts_Liberal_Control_DoM_p, LibArts_Conservative_Control_DoM_p,
                LibArts_Liberal_Conservative_DoM_p, Religious_Liberal_Control_DoM_p,
                Religious_Conservative_Control_DoM_p, Religious_Liberal_Conservative_DoM_p,
                NonReligious_Liberal_Control_DoM_p, NonReligious_Conservative_Control_DoM_p,
                NonReligious_Liberal_Conservative_DoM_p, Southern_Liberal_Control_DoM_p,
                Southern_Conservative_Control_DoM_p, Southern_Liberal_Conservative_DoM_p,
                NonSouthern_Liberal_Control_DoM_p, NonSouthern_Conservative_Control_DoM_p,
                NonSouthern_Liberal_Conservative_DoM_p, Urban_Liberal_Control_DoM_p,
                Urban_Conservative_Control_DoM_p, Urban_Liberal_Conservative_DoM_p,
                Rural_Liberal_Control_DoM_p, Rural_Conservative_Control_DoM_p,
                Rural_Liberal_Conservative_DoM_p)

# Difference of Means Latex Output Table
# domconfidenceintervals object contains only lower confidence interval bounds
# Insert brackets, commas, and upper confidence interval bounds in Latex manually 
# must adjust size in Latex (scalebox =.85)
library(Hmisc)
Test <- matrix(NA, 24, 5)
colnames(Test) <- c("n", "Diff. Means", "95% CI", 
                    "T-statistic", "p-value")
rownames(Test) <- c("Liberal-Control, Overall","Conservative-Control, Overall",
                    "Liberal-Conservative, Overall", "Liberal-Control, Liberal Arts",
                    "Conservative-Control, Liberal Arts",
                    "Liberal-Conservative, Liberal Arts",
                    "Liberal-Control, Religious",
                    "Conservative-Control, Religious",
                    "Liberal-Conservative, Religious",
                    "Liberal-Control, NonReligious",
                    "Conservative-Control, NonReligious",
                    "Liberal-Conservative, NonReligious",
                    "Liberal-Control, Southern",
                    "Conservative-Control, Southern",
                    "Liberal-Conservative, Southern",
                    "Liberal-Control, NonSouthern",
                    "Conservative-Control, NonSouthern",
                    "Liberal-Conservative, NonSouthern",
                    "Liberal-Control, Urban",
                    "Conservative-Control, Urban",
                    "Liberal-Conservative, Urban",
                    "Liberal-Control, Rural",
                    "Conservative-Control, Rural",
                    "Liberal-Conservative, Rural") 
Test[ ,1] <- dom_n
Test[ ,2] <- differencesofmeans
Test[ ,3] <- domconfidenceintervalslow
Test[ ,4] <- domtstatistics
Test[ ,5] <- dompvalues
latex(Test, file = "")

# Observed Response sample sizes, response rates and Standard Deviations---------------------------------------------
# N Overall
Overall_Liberal_n <- length(na.omit(Liberal_dataset_room$reply))
Overall_Conservative_n <- length(na.omit(Conservative_dataset_room$reply))
Overall_Control_n <- length(na.omit(Control_dataset_room$reply))

# RR Overall 
Observed_rr_overall <- round(mean(na.omit(roomdata_rand$reply)), digits=2)
Observed_rr_overall_Liberal <- round(mean(na.omit(Liberal_dataset_room$reply)), digits=2)
Observed_rr_overall_Conservative <- round(mean(na.omit(Conservative_dataset_room$reply)), digits=2)
Observed_rr_overall_Control <- round(mean(na.omit(Control_dataset_room$reply)), digits=2)

# Standard Error, Overall
SE_Overall_Liberal <- sqrt((Observed_rr_overall_Liberal*(1-Observed_rr_overall_Liberal))/Overall_Liberal_n)
SE_Overall_Conservative <- sqrt((Observed_rr_overall_Conservative*(1-Observed_rr_overall_Conservative))/Overall_Conservative_n)
SE_Overall_Control <- sqrt((Observed_rr_overall_Control*(1-Observed_rr_overall_Control))/Overall_Control_n)

# Plot of Response Rates +/- 1.96*Standard Error
RR_vector <- c(Observed_rr_overall_Liberal, Observed_rr_overall_Control, Observed_rr_overall_Conservative)
labels <- c("\nLiberal \nn=450", "\nControl \nn=455", "\nConservative \nn=461")
treats <- c(1,2,3)

# 95% Normal Theory Confidence Intervals
up.ci.overall <- c(Observed_rr_overall_Liberal + 1.96*SE_Overall_Liberal,
                   Observed_rr_overall_Control + 1.96*SE_Overall_Control, 
                   Observed_rr_overall_Conservative + 1.96*SE_Overall_Conservative)

low.ci.overall <- c(Observed_rr_overall_Liberal - 1.96*SE_Overall_Liberal,
                    Observed_rr_overall_Control - 1.96*SE_Overall_Control, 
                    Observed_rr_overall_Conservative - 1.96*SE_Overall_Conservative)

# Plot of Response Rates and Confidence Intervals
RR_plot <- plot(treats, RR_vector, xlab="Experimental Group", 
                ylab="Reply at All Response Rate", ylim = c(0.3, 0.65), xaxt = 'n', family = "serif" )
arrows(treats, low.ci.overall, treats, up.ci.overall, length=0.05, angle=90, code=3)
axis(1, at=1:3, family = "serif", labels=labels)

# Substantive Reply Plot, overall sample
# N Overall Substantive
Overall_Liberal_n_sub <- length(na.omit(Liberal_dataset_room$substantive))
Overall_Conservative_n_sub <- length(na.omit(Conservative_dataset_room$substantive))
Overall_Control_n_sub <- length(na.omit(Control_dataset_room$substantive))

# RR Overall 
Observed_rr_overall_sub <- round(mean(na.omit(roomdata_rand$substantive)), digits=2)
Observed_rr_overall_Liberal_sub <- round(mean(na.omit(Liberal_dataset_room$substantive)), digits=2)
Observed_rr_overall_Conservative_sub <- round(mean(na.omit(Conservative_dataset_room$substantive)), digits=2)
Observed_rr_overall_Control_sub <- round(mean(na.omit(Control_dataset_room$substantive)), digits=2)

# Plot of Response Rates, Standard Errors and N
# Standard Error, Overall
SE_Overall_Liberal_sub <- sqrt((Observed_rr_overall_Liberal_sub*(1-Observed_rr_overall_Liberal_sub))/Overall_Liberal_n_sub)
SE_Overall_Conservative_sub <- sqrt((Observed_rr_overall_Conservative_sub*(1-Observed_rr_overall_Conservative_sub))/Overall_Conservative_n_sub)
SE_Overall_Control_sub <- sqrt((Observed_rr_overall_Control_sub*(1-Observed_rr_overall_Control_sub))/Overall_Control_n_sub)

# Plot of Response Rates +/- 1.96*Standard Error
RR_vector_sub <- c(Observed_rr_overall_Liberal_sub, 
                   Observed_rr_overall_Control_sub, 
                   Observed_rr_overall_Conservative_sub)
treats <- c(1,2,3)

# 95% Normal Theory Confidence Intervals
up.ci.overall.sub <- c(Observed_rr_overall_Liberal_sub + 1.96*SE_Overall_Liberal_sub,
                       Observed_rr_overall_Control_sub + 1.96*SE_Overall_Control_sub, 
                       Observed_rr_overall_Conservative_sub + 1.96*SE_Overall_Conservative_sub)

low.ci.overall.sub <- c(Observed_rr_overall_Liberal_sub - 1.96*SE_Overall_Liberal_sub,
                        Observed_rr_overall_Control_sub - 1.96*SE_Overall_Control_sub, 
                        Observed_rr_overall_Conservative_sub - 1.96*SE_Overall_Conservative_sub)

# Plot of Response Rates and Confidence Intervals
RR_plot_sub <- plot(treats, RR_vector_sub, xlab="Experimental Group", 
                    ylab="Substantive Response Rate", ylim = c(0.3, 0.65), xaxt = 'n', family = "serif" )
arrows(treats, low.ci.overall.sub, treats, up.ci.overall.sub, length=0.05, angle=90, code=3)
axis(1, at=1:3, family = "serif", labels=labels)

# Days to Reply Plot, overall sample
# N Overall Days
Overall_Liberal_n_days <- length(na.omit(Liberal_dataset_room$days))
Overall_Conservative_n_days <- length(na.omit(Conservative_dataset_room$days))
Overall_Control_n_days <- length(na.omit(Control_dataset_room$days))

# RR Overall 
Observed_rr_overall_Liberal_days <- round(mean(na.omit(Liberal_dataset_room$days)), digits=2)
Observed_rr_overall_Conservative_days <- round(mean(na.omit(Conservative_dataset_room$days)), digits=2)
Observed_rr_overall_Control_days <- round(mean(na.omit(Control_dataset_room$days)), digits=2)

# Standard Error of Days to Reply, Overall
SE_Overall_Liberal_days <- sd(na.omit(Liberal_dataset_room$days))/sqrt(Overall_Liberal_n_days)
SE_Overall_Conservative_days <- sd(na.omit(Conservative_dataset_room$days))/sqrt(Overall_Conservative_n_days)
SE_Overall_Control_days <- sd(na.omit(Control_dataset_room$days))/sqrt(Overall_Control_n_days)

# Plot of Response Rates +/- 1.96*Standard Error
RR_vector_days <- c(Observed_rr_overall_Liberal_days, 
                    Observed_rr_overall_Control_days, 
                    Observed_rr_overall_Conservative_days)
labels <- c("\nLiberal \nn=465", "\nControl \nn=465", "\nConservative \nn=469")
treats <- c(1,2,3)

# 95% Normal Theory Confidence Intervals
up.ci.overall.days <- c(Observed_rr_overall_Liberal_days + 1.96*SE_Overall_Liberal_days,
                        Observed_rr_overall_Control_days + 1.96*SE_Overall_Control_days, 
                        Observed_rr_overall_Conservative_days + 1.96*SE_Overall_Conservative_days)

low.ci.overall.days <- c(Observed_rr_overall_Liberal_days - 1.96*SE_Overall_Liberal_days,
                         Observed_rr_overall_Control_days - 1.96*SE_Overall_Control_days, 
                         Observed_rr_overall_Conservative_days - 1.96*SE_Overall_Conservative_days)

# Plot of Response Rates and Confidence Intervals
RR_plot_days <- plot(treats, RR_vector_days, xlab="Experimental Group", 
                     ylab="Days to Reply", ylim = c(10, 20), xaxt = 'n', family = "serif" )
arrows(treats, low.ci.overall.days, treats, up.ci.overall.days, length=0.05, angle=90, code=3)
axis(1, at=1:3, family = "serif", labels=labels)








# 3 pane figure Reply at All, Substantive Reply, Days to Reply
par(mfrow=c(1,3))

RR_plot <- plot(treats, RR_vector, xlab="Experimental Group", 
                ylab="Reply at All Response Rate", ylim = c(0.3, 0.65), xaxt = 'n', family = "serif" )
arrows(treats, low.ci.overall, treats, up.ci.overall, length=0.05, angle=90, code=3)
axis(1, at=1:3, family = "serif", labels=labels)

RR_plot_sub <- plot(treats, RR_vector_sub, xlab="Experimental Group", 
                    ylab="Substantive Response Rate", ylim = c(0.3, 0.65), xaxt = 'n', family = "serif" )
arrows(treats, low.ci.overall.sub, treats, up.ci.overall.sub, length=0.05, angle=90, code=3)
axis(1, at=1:3, family = "serif", labels=labels)

RR_plot_days <- plot(treats, RR_vector_days, xlab="Experimental Group", 
                     ylab="Days to Reply", ylim = c(10, 20), xaxt = 'n', family = "serif" )
arrows(treats, low.ci.overall.days, treats, up.ci.overall.days, length=0.05, angle=90, code=3)
axis(1, at=1:3, family = "serif", labels=labels)









# N National Liberal Arts Colleges
LibArts_Liberal_n <- length(na.omit(Liberal_Arts_Colleges_Liberal_dataset_room$reply))
LibArts_Conservative_n <- length(na.omit(Liberal_Arts_Colleges_Conservative_dataset_room$reply))
LibArts_Control_n <- length(na.omit(Liberal_Arts_Colleges_Control_dataset_room$reply))

# RR National Liberal Arts Colleges
Observed_rr_LibArts_Liberal <- round(mean(na.omit(Liberal_Arts_Colleges_Liberal_dataset_room$reply)), digits=2)
Observed_rr_LibArts_Conservative <- round(mean(na.omit(Liberal_Arts_Colleges_Conservative_dataset_room$reply)), digits=2)
Observed_rr_LibArts_Control <- round(mean(na.omit(Liberal_Arts_Colleges_Control_dataset_room$reply)), digits=2)

# SD National Liberal Arts Colleges
Observed_rr_LibArts_Liberal_sd <- round(sd(na.omit(Liberal_Arts_Colleges_Liberal_dataset_room$reply)), digits=2)
Observed_rr_LibArts_Conservative_sd <- round(sd(na.omit(Liberal_Arts_Colleges_Conservative_dataset_room$reply)), digits=2)
Observed_rr_LibArts_Control_sd <- round(sd(na.omit(Liberal_Arts_Colleges_Control_dataset_room$reply)), digits=2)

# N Southern Colleges
South_Liberal_n <- length(na.omit(Southern_Liberal_dataset_room$reply))
South_Conservative_n <- length(na.omit(Southern_Conservative_dataset_room$reply))
South_Control_n <- length(na.omit(Southern_Control_dataset_room$reply))

# RR Southern Colleges
Observed_rr_Southern_Liberal <- round(mean(na.omit(Southern_Liberal_dataset_room$reply)), digits=2)
Observed_rr_Southern_Conservative <- round(mean(na.omit(Southern_Conservative_dataset_room$reply)), digits=2)
Observed_rr_Southern_Control <- round(mean(na.omit(Southern_Control_dataset_room$reply)), digits=2)

# SD Southern Colleges
Observed_rr_Southern_Liberal_sd <- round(sd(na.omit(Southern_Liberal_dataset_room$reply)), digits=2)
Observed_rr_Southern_Conservative_sd <- round(sd(na.omit(Southern_Conservative_dataset_room$reply)), digits=2)
Observed_rr_Southern_Control_sd <- round(sd(na.omit(Southern_Control_dataset_room$reply)), digits=2)

# N NonSouthern Colleges
NonSouth_Liberal_n <- length(na.omit(NonSouthern_Liberal_dataset_room$reply))
NonSouth_Conservative_n <- length(na.omit(NonSouthern_Conservative_dataset_room$reply))
NonSouth_Control_n <- length(na.omit(NonSouthern_Control_dataset_room$reply))

# RR NonSouthern Colleges
Observed_rr_NonSouthern_Liberal <- round(mean(na.omit(NonSouthern_Liberal_dataset_room$reply)), digits=2)
Observed_rr_NonSouthern_Conservative <- round(mean(na.omit(NonSouthern_Conservative_dataset_room$reply)), digits=2)
Observed_rr_NonSouthern_Control <- round(mean(na.omit(NonSouthern_Control_dataset_room$reply)), digits=2)

# SD NonSouthern Colleges
Observed_rr_NonSouthern_Liberal_sd <- round(sd(na.omit(NonSouthern_Liberal_dataset_room$reply)), digits=2)
Observed_rr_NonSouthern_Conservative_sd <- round(sd(na.omit(NonSouthern_Conservative_dataset_room$reply)), digits=2)
Observed_rr_NonSouthern_Control_sd <- round(sd(na.omit(NonSouthern_Control_dataset_room$reply)), digits=2)

# N Religious Colleges
Religious_Liberal_n <- length(na.omit(Religious_Colleges_Liberal_dataset_room$reply))
Religious_Conservative_n <- length(na.omit(Religious_Colleges_Conservative_dataset_room$reply))
Religious_Control_n <- length(na.omit(Religious_Colleges_Control_dataset_room$reply))

# RR Religious Colleges
Observed_rr_Religious_Liberal <- round(mean(na.omit(Religious_Colleges_Liberal_dataset_room$reply)), digits=2)
Observed_rr_Religious_Conservative <- round(mean(na.omit(Religious_Colleges_Conservative_dataset_room$reply)), digits=2)
Observed_rr_Religious_Control <- round(mean(na.omit(Religious_Colleges_Control_dataset_room$reply)), digits=2)

# SD Religious Colleges
Observed_rr_Religious_Liberal_sd <- round(sd(na.omit(Religious_Colleges_Liberal_dataset_room$reply)), digits=2)
Observed_rr_Religious_Conservative_sd <- round(sd(na.omit(Religious_Colleges_Conservative_dataset_room$reply)), digits=2)
Observed_rr_Religious_Control_sd <- round(sd(na.omit(Religious_Colleges_Control_dataset_room$reply)), digits=2)

# N NonReligious Colleges
NonReligious_Liberal_n <- length(na.omit(NonReligious_Colleges_Liberal_dataset_room$reply))
NonReligious_Conservative_n <- length(na.omit(NonReligious_Colleges_Conservative_dataset_room$reply))
NonReligious_Control_n <- length(na.omit(NonReligious_Colleges_Control_dataset_room$reply))

# RR NonReligious Colleges
Observed_rr_NonReligious_Liberal <- round(mean(na.omit(NonReligious_Colleges_Liberal_dataset_room$reply)), digits=2)
Observed_rr_NonReligious_Conservative <- round(mean(na.omit(NonReligious_Colleges_Conservative_dataset_room$reply)), digits=2)
Observed_rr_NonReligious_Control <- round(mean(na.omit(NonReligious_Colleges_Control_dataset_room$reply)), digits=2)

# SD NonReligious Colleges
Observed_rr_NonReligious_Liberal_sd <- round(sd(na.omit(NonReligious_Colleges_Liberal_dataset_room$reply)), digits=2)
Observed_rr_NonReligious_Conservative_sd <- round(sd(na.omit(NonReligious_Colleges_Conservative_dataset_room$reply)), digits=2)
Observed_rr_NonReligious_Control_sd <- round(sd(na.omit(NonReligious_Colleges_Control_dataset_room$reply)), digits=2)

# N Urban Colleges
Urban_Liberal_n <- length(na.omit(Urban_Liberal_dataset_room$reply))
Urban_Conservative_n <- length(na.omit(Urban_Conservative_dataset_room$reply))
Urban_Control_n <- length(na.omit(Urban_Control_dataset_room$reply))

# RR Urban Colleges
Observed_rr_Urban_Liberal <- round(mean(na.omit(Urban_Liberal_dataset_room$reply)), digits=2)
Observed_rr_Urban_Conservative <- round(mean(na.omit(Urban_Conservative_dataset_room$reply)), digits=2)
Observed_rr_Urban_Control <- round(mean(na.omit(Urban_Control_dataset_room$reply)), digits=2)

# SD Urban Colleges
Observed_rr_Urban_Liberal_sd <- round(sd(na.omit(Urban_Liberal_dataset_room$reply)), digits=2)
Observed_rr_Urban_Conservative_sd <- round(sd(na.omit(Urban_Conservative_dataset_room$reply)), digits=2)
Observed_rr_Urban_Control_sd <- round(sd(na.omit(Urban_Control_dataset_room$reply)), digits=2)

# N Rural Colleges
Rural_Liberal_n <- length(na.omit(Rural_Liberal_dataset_room$reply))
Rural_Conservative_n <- length(na.omit(Rural_Conservative_dataset_room$reply))
Rural_Control_n <- length(na.omit(Rural_Control_dataset_room$reply))

# RR Rural Colleges
Observed_rr_Rural_Liberal <- round(mean(na.omit(Rural_Liberal_dataset_room$reply)), digits=2)
Observed_rr_Rural_Conservative <- round(mean(na.omit(Rural_Conservative_dataset_room$reply)), digits=2)
Observed_rr_Rural_Control <- round(mean(na.omit(Rural_Control_dataset_room$reply)), digits=2)

# SD Rural Colleges
Observed_rr_Rural_Liberal_sd <- round(sd(na.omit(Rural_Liberal_dataset_room$reply)), digits=2)
Observed_rr_Rural_Conservative_sd <- round(sd(na.omit(Rural_Conservative_dataset_room$reply)), digits=2)
Observed_rr_Rural_Control_sd <- round(sd(na.omit(Rural_Control_dataset_room$reply)), digits=2)

# Combining all sample sizes, observed response rates, and standard deviations into vectors for table
n_liberal <- c(Overall_Liberal_n, LibArts_Liberal_n, South_Liberal_n, NonSouth_Liberal_n, Religious_Liberal_n,
               NonReligious_Liberal_n, Urban_Liberal_n, Rural_Liberal_n)

n_control <- c(Overall_Control_n, LibArts_Control_n, South_Control_n, NonSouth_Control_n, Religious_Control_n,
               NonReligious_Control_n, Urban_Control_n, Rural_Control_n)

n_conservative <- c(Overall_Conservative_n, LibArts_Conservative_n, South_Conservative_n, NonSouth_Conservative_n, 
                    Religious_Conservative_n, NonReligious_Conservative_n, Urban_Conservative_n, Rural_Conservative_n)

observed_rrs_liberal <- c(Observed_rr_overall_Liberal, Observed_rr_LibArts_Liberal, Observed_rr_Southern_Liberal,
                          Observed_rr_NonSouthern_Liberal, Observed_rr_Religious_Liberal, 
                          Observed_rr_NonReligious_Liberal, Observed_rr_Urban_Liberal, Observed_rr_Rural_Liberal)

observed_rrs_control <- c(Observed_rr_overall_Control, Observed_rr_LibArts_Control, Observed_rr_Southern_Control,
                          Observed_rr_NonSouthern_Control, Observed_rr_Religious_Control, 
                          Observed_rr_NonReligious_Control, Observed_rr_Urban_Control, Observed_rr_Rural_Control)

observed_rrs_conservative <- c(Observed_rr_overall_Conservative, Observed_rr_LibArts_Conservative,
                               Observed_rr_Southern_Conservative, Observed_rr_NonSouthern_Conservative, 
                               Observed_rr_Religious_Conservative, Observed_rr_NonReligious_Conservative, 
                               Observed_rr_Urban_Conservative, Observed_rr_Rural_Conservative)

observed_sd_liberal <- c(Observed_rr_overall_Liberal_sd, Observed_rr_LibArts_Liberal_sd, 
                         Observed_rr_Southern_Liberal_sd,Observed_rr_NonSouthern_Liberal_sd,
                         Observed_rr_Religious_Liberal_sd,Observed_rr_NonReligious_Liberal_sd,
                         Observed_rr_Urban_Liberal_sd, Observed_rr_Rural_Liberal_sd)

observed_sd_control <- c(Observed_rr_overall_Control_sd, Observed_rr_LibArts_Control_sd,
                         Observed_rr_Southern_Control_sd, Observed_rr_NonSouthern_Control_sd,
                         Observed_rr_Religious_Control_sd, Observed_rr_NonReligious_Control_sd,
                         Observed_rr_Urban_Control_sd, Observed_rr_Rural_Control_sd)


observed_sd_conservative <- c(Observed_rr_overall_Conservative_sd, Observed_rr_LibArts_Conservative_sd,
                              Observed_rr_Southern_Conservative_sd, Observed_rr_NonSouthern_Conservative_sd, 
                              Observed_rr_Religious_Conservative_sd, Observed_rr_NonReligious_Conservative_sd, 
                              Observed_rr_Urban_Conservative_sd, Observed_rr_Rural_Conservative_sd)

# Table: Observed Response Rates Across Conditions and by School Characteristics 
library(Hmisc)
Sample <- matrix(NA, 8, 9)
colnames(Sample) <- c("Lib. \n n", "Contr. \n n", "Conserv. \n n", 
                      "Lib. \n RR", "Contr. \n RR", "Conserv. \n RR", 
                      "Lib. \n SD", "Contr. \n SD", "Conserv. \n SD")
rownames(Sample) <- c("Overall", "Liberal Arts", "South", "Non-South", "Religious", "Non-Religious", "Urban", "Rural") 
Sample[ ,1] <- n_liberal
Sample[ ,2] <- n_control
Sample[ ,3] <- n_conservative
Sample[ ,4] <- observed_rrs_liberal
Sample[ ,5] <- observed_rrs_control
Sample[ ,6] <- observed_rrs_conservative
Sample[ ,7] <- observed_sd_liberal
Sample[ ,8] <- observed_sd_control
Sample[ ,9] <- observed_sd_conservative
latex(Sample, file = "")

# Predicted Probabilities of Response ------------------------------------------------------------------------
# Overall Sample
# Model for calculations of predicted probability of response in overall sample
results_room <-glm(as.numeric(reply) ~ 
                          + I(condition=="Liberal")
                        + I(condition=="Conservative"),
                        data = roomdata_rand, 
                        family = binomial(link = "logit"))

summary(results_room)

# Predicted Probability of Replying to the Liberal Student, Overall Sample
x.Liberal <- c(1, 1, 0)
z.Liberal <- sum(results_room$coef * x.Liberal)
pp_Liberal_overall <- plogis(z.Liberal) 

# Predicted Probability of Replying to the Control Student, Overall Sample
x.Control.o <- c(1, 0, 0)
z.Control.o <- sum(results_room$coef * x.Control.o)
pp_Control_overall <- plogis(z.Control.o) 

# Predicted Probability of Replying to the Conservative Student, Overall Sample
x.Conservative.o <- c(1, 0, 1)
z.Conservative.o <- sum(results_room$coef * x.Conservative.o)
pp_Conservative_overall <- plogis(z.Conservative.o) 

# Liberal Arts Sample
# Liberal Arts Colleges Dataset
LibArt <- roomdata_rand[roomdata_rand$num_school_type == 2, ]

# Liberal Arts Colleges Model
libartsmodel <-glm(as.numeric(reply) ~ 
                     + I(condition=="Liberal") 
                   + I(condition=="Conservative"),
                   data = LibArt, 
                   family = binomial(link = "logit"))

summary(libartsmodel)

# Predicted Probability of Replying to the Liberal Student, Liberal Arts Colleges
x.Liberal.LibArts <- c(1, 1, 0)
z.Liberal.LibArts  <- sum(libartsmodel$coef * x.Liberal.LibArts )
pp_Liberal_LibArts <- plogis(z.Liberal.LibArts) 

# Predicted Probability of Replying to the Control Student, Liberal Arts Colleges
x.Control.LibArts <- c(1, 0, 0)
z.Control.LibArts  <- sum(libartsmodel$coef * x.Control.LibArts )
pp_Control_LibArts <- plogis(z.Control.LibArts) 

# Predicted Probability of Replying to the Conservative Student, Liberal Arts Colleges
x.Conservative.LibArts <- c(1, 0, 1)
z.Conservative.LibArts  <- sum(libartsmodel$coef * x.Conservative.LibArts )
pp_Conservative_LibArts <- plogis(z.Conservative.LibArts) 

# Southern Sample
# Southern Colleges Dataset
South <- roomdata_rand[roomdata_rand$region == "South", ]

# Model with Southern Colleges Data
Southmodel <-glm(as.numeric(reply) ~ 
                   + I(condition=="Liberal") 
                 + I(condition=="Conservative"),
                 data = South, 
                 family = binomial(link = "logit"))

summary(Southmodel)

# Predicted Probability of Replying to the Liberal Student, Southern Colleges
x.Liberal.South <- c(1, 1, 0)
z.Liberal.South <- sum(Southmodel$coef * x.Liberal.South)
pp_Liberal_South <- plogis(z.Liberal.South) 

# Predicted Probability of Replying to the Control Student, Southern Colleges
x.Control.South <- c(1, 0, 0)
z.Control.South  <- sum(Southmodel$coef * x.Control.South)
pp_Control_South <- plogis(z.Control.South) 

# Predicted Probability of Replying to the Conservative Student, Southern Colleges
x.Conservative.South <- c(1, 0, 1)
z.Conservative.South  <- sum(Southmodel$coef * x.Conservative.South )
pp_Conservative_South <- plogis(z.Conservative.South) 

# NonSouthern Sample
# NonSouthern Colleges Dataset
NonSouth <- roomdata_rand[roomdata_rand$region != "South", ]

# Model with NonSouthern Colleges Data
NonSouthmodel <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = NonSouth, 
                    family = binomial(link = "logit"))

summary(NonSouthmodel)

# Predicted Probability of Replying to the Liberal Student, NonSouthern Colleges
x.Liberal.NonSouth <- c(1, 1, 0)
z.Liberal.NonSouth <- sum(NonSouthmodel$coef * x.Liberal.NonSouth)
pp_Liberal_NonSouth <- plogis(z.Liberal.NonSouth) 

# Predicted Probability of Replying to the Control Student, NonSouthern Colleges
x.Control.NonSouth <- c(1, 0, 0)
z.Control.NonSouth  <- sum(NonSouthmodel$coef * x.Control.NonSouth)
pp_Control_NonSouth <- plogis(z.Control.NonSouth) 

# Predicted Probability of Replying to the Conservative Student, NonSouthern Colleges
x.Conservative.NonSouth <- c(1, 0, 1)
z.Conservative.NonSouth  <- sum(NonSouthmodel$coef * x.Conservative.NonSouth )
pp_Conservative_NonSouth <- plogis(z.Conservative.NonSouth) 

# Religious Sample
# Religious Colleges Dataset
Religious <- roomdata_rand[roomdata_rand$religious == 1, ]

# Model with Religious Colleges Data
Religiousmodel <-glm(as.numeric(reply) ~ 
                       + I(condition=="Liberal") 
                     + I(condition=="Conservative"),
                     data = Religious, 
                     family = binomial(link = "logit"))

summary(Religiousmodel)

# Predicted Probability of Replying to the Liberal Student, Religious Colleges
x.Liberal.Religious <- c(1, 1, 0)
z.Liberal.Religious <- sum(Religiousmodel$coef * x.Liberal.Religious)
pp_Liberal_Religious <- plogis(z.Liberal.Religious) 

# Predicted Probability of Replying to the Control Student, Religious Colleges
x.Control.Religious <- c(1, 0, 0)
z.Control.Religious  <- sum(Religiousmodel$coef * x.Control.Religious)
pp_Control_Religious <- plogis(z.Control.Religious) 

# Predicted Probability of Replying to the Conservative Student, Religious Colleges
x.Conservative.Religious <- c(1, 0, 1)
z.Conservative.Religious  <- sum(Religiousmodel$coef * x.Conservative.Religious)
pp_Conservative_Religious <- plogis(z.Conservative.Religious) 

# NonReligious Sample
# NonReligious Colleges Dataset
NonReligious <- roomdata_rand[roomdata_rand$religious == 0, ]

# Model with NonReligious Colleges Data
NonReligiousmodel <-glm(as.numeric(reply) ~ 
                          + I(condition=="Liberal") 
                        + I(condition=="Conservative"),
                        data = NonReligious, 
                        family = binomial(link = "logit"))

summary(NonReligiousmodel)

# Predicted Probability of Replying to the Liberal Student, NonReligious Colleges
x.Liberal.NonReligious <- c(1, 1, 0)
z.Liberal.NonReligious <- sum(NonReligiousmodel$coef * x.Liberal.NonReligious)
pp_Liberal_NonReligious <- plogis(z.Liberal.NonReligious) 

# Predicted Probability of Replying to the Control Student, NonReligious Colleges
x.Control.NonReligious <- c(1, 0, 0)
z.Control.NonReligious  <- sum(NonReligiousmodel$coef * x.Control.NonReligious)
pp_Control_NonReligious <- plogis(z.Control.NonReligious) 

# Predicted Probability of Replying to the Conservative Student, NonReligious Colleges
x.Conservative.NonReligious <- c(1, 0, 1)
z.Conservative.NonReligious  <- sum(NonReligiousmodel$coef * x.Conservative.NonReligious)
pp_Conservative_NonReligious <- plogis(z.Conservative.NonReligious) 

# Urban Sample
# Urban Colleges Dataset
Urban <- roomdata_rand[roomdata_rand$setting == "urban", ]

# Model with Urban Colleges Data
Urbanmodel <-glm(as.numeric(reply) ~ 
                   + I(condition=="Liberal") 
                 + I(condition=="Conservative"),
                 data = Urban, 
                 family = binomial(link = "logit"))

summary(Urbanmodel)

# Predicted Probability of Replying to the Liberal Student, Urban Colleges
x.Liberal.Urban <- c(1, 1, 0)
z.Liberal.Urban <- sum(Urbanmodel$coef * x.Liberal.Urban)
pp_Liberal_Urban <- plogis(z.Liberal.Urban) 

# Predicted Probability of Replying to the Control Student, Urban Colleges
x.Control.Urban <- c(1, 0, 0)
z.Control.Urban  <- sum(Urbanmodel$coef * x.Control.Urban)
pp_Control_Urban <- plogis(z.Control.Urban) 

# Predicted Probability of Replying to the Conservative Student, Urban Colleges
x.Conservative.Urban <- c(1, 0, 1)
z.Conservative.Urban  <- sum(Urbanmodel$coef * x.Conservative.Urban)
pp_Conservative_Urban <- plogis(z.Conservative.Urban) 

# Rural Sample
# Rural Colleges Dataset
Rural <- roomdata_rand[roomdata_rand$setting == "rural", ]

# Model with Rural Colleges Data
Ruralmodel <-glm(as.numeric(reply) ~ 
                   + I(condition=="Liberal") 
                 + I(condition=="Conservative"),
                 data = Rural, 
                 family = binomial(link = "logit"))

summary(Ruralmodel)

# Predicted Probability of Replying to the Liberal Student, Rural Colleges
x.Liberal.Rural <- c(1, 1, 0)
z.Liberal.Rural <- sum(Ruralmodel$coef * x.Liberal.Rural)
pp_Liberal_Rural <- plogis(z.Liberal.Rural) 

# Predicted Probability of Replying to the Control Student, Rural Colleges
x.Control.Rural <- c(1, 0, 0)
z.Control.Rural  <- sum(Ruralmodel$coef * x.Control.Rural)
pp_Control_Rural <- plogis(z.Control.Rural) 

# Predicted Probability of Replying to the Conservative Student, Rural Colleges
x.Conservative.Rural <- c(1, 0, 1)
z.Conservative.Rural  <- sum(Ruralmodel$coef * x.Conservative.Rural)
pp_Conservative_Rural <- plogis(z.Conservative.Rural) 

# Generating Confidence Intervals from Bootstrap Samples of Predicted Probability Estimates ------------
# Confidence Interval Around Predicted Probability of Response to Liberal Student, Overall Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Liberal Student, Overall Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(roomdata_rand), replace = TRUE)
  dat.boot <- roomdata_rand[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,1,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis (z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Liberal.overall <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Liberal Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Liberal.overall.low <- ordered.boot[25]
ci.Liberal.overall.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Control Student, Overall Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Control Student, Overall Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(roomdata_rand), replace = TRUE)
  dat.boot <- roomdata_rand[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Control.overall <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying in Control
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Control.overall.low <- ordered.boot[25]
ci.Control.overall.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Conservative Student, Overall Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Conservative Student, Overall Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(roomdata_rand), replace = TRUE)
  dat.boot <- roomdata_rand[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,1)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Conservative.overall <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Conservative Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Conservative.overall.low <- ordered.boot[25]
ci.Conservative.overall.high <- ordered.boot[975]

# Confidence Intervals for National Liberal Arts College PP Estimates
# Confidence Interval Around Predicted Probability of Response to Liberal Student, LibArts Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Liberal Student, LibArts Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(LibArt), replace = TRUE)
  dat.boot <- LibArt[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,1,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Liberal.LibArt <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Liberal Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Liberal.LibArt.low <- ordered.boot[25]
ci.Liberal.LibArt.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Control Student, LibArts Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Control Student, LibArts Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(LibArt), replace = TRUE)
  dat.boot <- LibArt[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Control.LibArt <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Control Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Control.LibArt.low <- ordered.boot[25]
ci.Control.LibArt.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Conservative Student, LibArts Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Conservative Student, LibArts Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(LibArt), replace = TRUE)
  dat.boot <- LibArt[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,1)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Conservative.LibArt <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Conservative Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Conservative.LibArt.low <- ordered.boot[25]
ci.Conservative.LibArt.high <- ordered.boot[975]

# Southern Schools 
# Confidence Interval Around Predicted Probability of Response to Liberal Student, Southern Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Liberal Student, Southern Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(South), replace = TRUE)
  dat.boot <- South[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,1,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Liberal.Southern <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Liberal Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Liberal.Southern.low <- ordered.boot[25]
ci.Liberal.Southern.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Control Student, Southern Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Control Student, Southern Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(South), replace = TRUE)
  dat.boot <- South[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Control.Southern <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Control Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Control.Southern.low <- ordered.boot[25]
ci.Control.Southern.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Conservative Student, Southern Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Conservative Student, Southern Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(South), replace = TRUE)
  dat.boot <- South[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,1)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Conservative.Southern <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Conservative Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Conservative.Southern.low <- ordered.boot[25]
ci.Conservative.Southern.high <- ordered.boot[975]

# NonSouth
# Confidence Interval Around Predicted Probability of Response to Liberal Student, NonSouthern Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Liberal Student, NonSouthern Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(NonSouth), replace = TRUE)
  dat.boot <- NonSouth[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,1,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Liberal.NonSouthern <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Liberal Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Liberal.NonSouthern.low <- ordered.boot[25]
ci.Liberal.NonSouthern.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Control Student, NonSouthern Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Control Student, NonSouthern Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(NonSouth), replace = TRUE)
  dat.boot <- NonSouth[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Control.NonSouthern <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Control Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Control.NonSouthern.low <- ordered.boot[25]
ci.Control.NonSouthern.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Conservative Student, NonSouthern Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Conservative Student, NonSouthern Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(NonSouth), replace = TRUE)
  dat.boot <- NonSouth[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,1)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Conservative.NonSouthern <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Conservative Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Conservative.NonSouthern.low <- ordered.boot[25]
ci.Conservative.NonSouthern.high <- ordered.boot[975]

# Religious Schools
# Confidence Interval Around Predicted Probability of Response to Liberal Student, Religious Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Liberal Student, Religious Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(Religious), replace = TRUE)
  dat.boot <- Religious[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,1,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Liberal.Religious <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Liberal Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Liberal.Religious.low <- ordered.boot[25]
ci.Liberal.Religious.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Control Student, Religious Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Control Student, Religious Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(Religious), replace = TRUE)
  dat.boot <- Religious[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Control.Religious <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Control Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Control.Religious.low <- ordered.boot[25]
ci.Control.Religious.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Conservative Student, Religious Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Conservative Student, Religious Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(Religious), replace = TRUE)
  dat.boot <- Religious[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,1)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Conservative.Religious <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Control Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Conservative.Religious.low <- ordered.boot[25]
ci.Conservative.Religious.high <- ordered.boot[975]

# NonReligious
# Confidence Interval Around Predicted Probability of Response to Liberal Student, NonReligious Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Liberal Student, NonReligious Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(NonReligious), replace = TRUE)
  dat.boot <- NonReligious[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,1,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Liberal.NonReligious <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Liberal Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Liberal.NonReligious.low <- ordered.boot[25]
ci.Liberal.NonReligious.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Control Student, NonReligious Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Control Student, NonReligious Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(NonReligious), replace = TRUE)
  dat.boot <- NonReligious[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Control.NonReligious <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Liberal Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Control.NonReligious.low <- ordered.boot[25]
ci.Control.NonReligious.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Conservative Student, NonReligious Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Conservative Student, NonReligious Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(NonReligious), replace = TRUE)
  dat.boot <- NonReligious[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,1)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Conservative.NonReligious <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Conservative Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Conservative.NonReligious.low <- ordered.boot[25]
ci.Conservative.NonReligious.high <- ordered.boot[975]

# Urban
# Confidence Interval Around Predicted Probability of Response to Liberal Student, Urban Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Liberal Student, Urban Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(Urban), replace = TRUE)
  dat.boot <- Urban[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,1,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Liberal.Urban <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Liberal Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Liberal.Urban.low <- ordered.boot[25]
ci.Liberal.Urban.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Control Student, Urban Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Control Student, Urban Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(Urban), replace = TRUE)
  dat.boot <- Urban[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Control.Urban <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Control Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Control.Urban.low <- ordered.boot[25]
ci.Control.Urban.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Conservative Student, Urban Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Conservative Student, Urban Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(Urban), replace = TRUE)
  dat.boot <- Urban[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,1)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Conservative.Urban <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Control Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Conservative.Urban.low <- ordered.boot[25]
ci.Conservative.Urban.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Liberal Student, Rural Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Liberal Student, Rural Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(Rural), replace = TRUE)
  dat.boot <- Rural[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,1,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Liberal.Rural <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Liberal Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Liberal.Rural.low <- ordered.boot[25]
ci.Liberal.Rural.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Control Student, Rural Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Control Student, Rural Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(Rural), replace = TRUE)
  dat.boot <- Rural[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,0)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Control.Rural <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Liberal Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Control.Rural.low <- ordered.boot[25]
ci.Control.Rural.high <- ordered.boot[975]

# Confidence Interval Around Predicted Probability of Response to Conservative Student, Rural Sample
# Bootstrap: 1000 Estimates of Predicted Probability of Response to Conservative Student, Rural Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(Rural), replace = TRUE)
  dat.boot <- Rural[sel,]
  
  # run logit in bootstrap sample
  reply_model <-glm(as.numeric(reply) ~ 
                      + I(condition=="Liberal") 
                    + I(condition=="Conservative"),
                    data = dat.boot, 
                    family = binomial(link = "logit"))
  
  summary(reply_model)
  
  # compute pp for bootstrap sample
  x <- c(1,0,1)
  z <- sum(reply_model$coefficients*x)
  pp.boot[m] <- plogis(z)
  
  cat(m,"\n")
}

# Standard error = standard deviation of sampling distribution
boot.se.Conservative.Rural <- sd(pp.boot)

# Percentile Theory Confidence Intervals for Predicted Probability of Replying to Liberal Student
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
ci.Conservative.Rural.low <- ordered.boot[25]
ci.Conservative.Rural.high <- ordered.boot[975]

# Predicted Probability Plot ------------------------------------------------------------
# Predicted Probability of Response Across Conditions, Overall Sample
pp.vector <- c(pp_Liberal_overall, pp_Control_overall, pp_Conservative_overall)
labels <- c("\nLiberal \nCondition", "\nControl \nCondition", "\nConservative \nCondition")
treats <- c(0,1,2)

# 95% Normal Theory Confidence Intervals
up.ci.overall <- c(pp_Liberal_overall + 1.96*boot.se.Liberal.overall,
                   pp_Control_overall + 1.96*boot.se.Control.overall, 
                   pp_Conservative_overall + 1.96*boot.se.Conservative.overall)
low.ci.overall <- c(pp_Liberal_overall - 1.96*boot.se.Liberal.overall,
                    pp_Control_overall - 1.96*boot.se.Control.overall, 
                    pp_Conservative_overall - 1.96*boot.se.Conservative.overall)

# Figure 1
# plot of predicted probability of response in each condition
# with 95% Normal Theory confidence intervals, overall sample
pp.plot <- plot(treats, pp.vector, family = "serif", ylim = c(0,1),
                xlab="Experimental Condition",
                ylab="Predicted Probability of Response", xaxt = 'n' )
arrows(treats, low.ci.overall, treats, up.ci.overall, length=0.05, angle=90, code=3)
axis(1, at=0:2, family = "serif", labels=labels)

# Adjusting for Multiple Comparisons
pvalues_multiple_comparisons <- as.numeric(c(Liberal_Control_DoM_p, Conservative_Control_DoM_p, 
                                             Liberal_Conservative_DoM_p, 
                                             LibArts_Liberal_Control_DoM_p,
                                             LibArts_Conservative_Control_DoM_p, 
                                             LibArts_Liberal_Conservative_DoM_p, 
                                             Religious_Liberal_Control_DoM_p, 
                                             Religious_Conservative_Control_DoM_p, 
                                             Religious_Liberal_Conservative_DoM_p, 
                                             NonReligious_Liberal_Control_DoM_p,
                                             NonReligious_Conservative_Control_DoM_p, 
                                             NonReligious_Liberal_Conservative_DoM_p,
                                             Southern_Liberal_Control_DoM_p, 
                                             Southern_Conservative_Control_DoM_p, 
                                             Southern_Liberal_Conservative_DoM_p, 
                                             NonSouthern_Liberal_Control_DoM_p,
                                             NonSouthern_Conservative_Control_DoM_p, 
                                             NonSouthern_Liberal_Conservative_DoM_p,
                                             Urban_Liberal_Control_DoM_p, 
                                             Urban_Conservative_Control_DoM_p,
                                             Urban_Liberal_Conservative_DoM_p, 
                                             Rural_Liberal_Control_DoM_p,
                                             Rural_Conservative_Control_DoM_p, 
                                             Rural_Liberal_Conservative_DoM_p))

pvalues_bonferonni <- p.adjust(pvalues_multiple_comparisons, 
                               method = "bonferroni", n = length(pvalues_multiple_comparisons))

pvalues_holm <- p.adjust(pvalues_multiple_comparisons,
                         method = "holm", n = length(pvalues_multiple_comparisons))

pvalues_hochberg <- p.adjust(pvalues_multiple_comparisons,
                             method = "hochberg", n = length(pvalues_multiple_comparisons))

pvalues_hommel <- p.adjust(pvalues_multiple_comparisons,
                           method = "hommel", n = length(pvalues_multiple_comparisons))

pvalues_fdr <- p.adjust(pvalues_multiple_comparisons, 
                        method = "fdr", n = length(pvalues_multiple_comparisons))

# Statistical Power Tests
# Conservative and Control Conditions
install.packages('pwr')
library('pwr')
pwr.t2n.test(n1 = 451, n2= 455, d = .2, sig.level =.05, power = NULL)

# Liberal and Control Conditions
pwr.t2n.test(n1 = 453, n2= 455, d = .2, sig.level =.05, power = NULL)


# Generating Confidence Intervals from Bootstrap Samples of Difference of Means Estimates -----------------------------------
# 90% Percentile Theory Confidence Interval Around Difference of Means, Liberal-Conservative Reply at all
# Bootstrap: 1000 Estimates of Difference of Means, Liberal-Conservative Reply at all
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(roomdata_rand), replace = TRUE)
  dat.boot <- roomdata_rand[sel,]
  
  # T Test 
  testing <- t.test(dat.boot$reply[dat.boot$condition == "Conservative"], dat.boot$reply[dat.boot$condition == "Liberal"],
                    alternative = c("two.sided"))
  
  pp.boot[m] <- testing$estimate[1] - testing$estimate[2]
  
  cat(m,"\n")
}

# 90% Percentile Theory Confidence Intervals for DoM Replying at All Liberal-Conservative
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
doM.liberal.conservative.reply.low <- ordered.boot[50]
doM.liberal.conservative.reply.high <- ordered.boot[950]

# 90% Percentile Theory Confidence Interval Around Difference of Means, Liberal-Conservative Substantive Reply, overall sample
# Bootstrap: 1000 Estimates of Difference of Means, Liberal-Conservative Substantive Reply, Overall Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(roomdata_rand), replace = TRUE)
  dat.boot <- roomdata_rand[sel,]
  
  # T Test 
  testing <- t.test(dat.boot$substantive[dat.boot$condition == "Conservative"], dat.boot$substantive[dat.boot$condition == "Liberal"],
                    alternative = c("two.sided"))
  
  pp.boot[m] <- testing$estimate[1] - testing$estimate[2]
  
  cat(m,"\n")
}

# Percentile Theory Confidence Intervals for DoM Substantive Reply Liberal-Conservative
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
doM.liberal.conservative.substantive.low <- ordered.boot[50]
doM.liberal.conservative.substantive.high <- ordered.boot[950]

# 90% Percentile Theory Confidence Interval Around Difference of Means, Liberal-Conservative Days to Reply, overall sample
# Bootstrap: 1000 Estimates of Difference of Means, Liberal-Conservative Days to Reply, Overall Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(roomdata_rand), replace = TRUE)
  dat.boot <- roomdata_rand[sel,]
  
  # T Test 
  testing <- t.test(dat.boot$days[dat.boot$condition == "Conservative"], dat.boot$days[dat.boot$condition == "Liberal"],
                    alternative = c("two.sided"))
  
  pp.boot[m] <- testing$estimate[1] - testing$estimate[2]
  
  cat(m,"\n")
}

# Percentile Theory Confidence Intervals for DoM Days to Reply, Liberal-Conservative
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
doM.liberal.conservative.days.low <- ordered.boot[50]
doM.liberal.conservative.days.high <- ordered.boot[950]

# Liberal-Control Comparisons -------------
# 90% Percentile Theory Confidence Interval Around Difference of Means, Liberal-Control Reply at all, overall sample
# Bootstrap: 1000 Estimates of Difference of Means, Liberal-Control Reply at all, Overall Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(roomdata_rand), replace = TRUE)
  dat.boot <- roomdata_rand[sel,]
  
  # T Test 
  testing <- t.test(dat.boot$reply[dat.boot$condition == "Control"], dat.boot$reply[dat.boot$condition == "Liberal"],
                    alternative = c("two.sided"))
  
  pp.boot[m] <- testing$estimate[1] - testing$estimate[2]
  
  cat(m,"\n")
}

# Percentile Theory Confidence Intervals for DoM Replying at All Liberal-Control
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
doM.liberal.control.reply.low <- ordered.boot[50]
doM.liberal.control.reply.high <- ordered.boot[950]

# 90% Percentile Theory Confidence Interval Around Difference of Means, Liberal-Control Substantive Reply, overall sample
# Bootstrap: 1000 Estimates of Difference of Means, Liberal-Control Substantive Reply, Overall Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(roomdata_rand), replace = TRUE)
  dat.boot <- roomdata_rand[sel,]
  
  # T Test 
  testing <- t.test(dat.boot$substantive[dat.boot$condition == "Control"], dat.boot$substantive[dat.boot$condition == "Liberal"],
                    alternative = c("two.sided"))
  
  pp.boot[m] <- testing$estimate[1] - testing$estimate[2]
  
  cat(m,"\n")
}

# Percentile Theory Confidence Intervals for DoM Substantive Reply Liberal-Control
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
doM.liberal.control.substantive.low <- ordered.boot[50]
doM.liberal.control.substantive.high <- ordered.boot[950]

# 90% Percentile Theory Confidence Interval Around Difference of Means, Liberal-Control Days to Reply, overall sample
# Bootstrap: 1000 Estimates of Difference of Means, Liberal-Control Days to Reply, Overall Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(roomdata_rand), replace = TRUE)
  dat.boot <- roomdata_rand[sel,]
  
  # T Test 
  testing <- t.test(dat.boot$days[dat.boot$condition == "Control"], dat.boot$days[dat.boot$condition == "Liberal"],
                    alternative = c("two.sided"))
  
  pp.boot[m] <- testing$estimate[1] - testing$estimate[2]
  
  cat(m,"\n")
}

# Percentile Theory Confidence Intervals for DoM Substantive Reply Liberal-Control
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
doM.liberal.control.days.low <- ordered.boot[50]
doM.liberal.control.days.high <- ordered.boot[950]

# Conservative-Control Comparisons -------------
# 90% Percentile Theory Confidence Interval Around Difference of Means, Conservative-Control Reply at all, overall sample
# Bootstrap: 1000 Estimates of Difference of Means, Conservative-Control Reply at all, Overall Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(roomdata_rand), replace = TRUE)
  dat.boot <- roomdata_rand[sel,]
  
  # T Test 
  testing <- t.test(dat.boot$reply[dat.boot$condition == "Control"], dat.boot$reply[dat.boot$condition == "Conservative"],
                    alternative = c("two.sided"))
  
  pp.boot[m] <- testing$estimate[1] - testing$estimate[2]
  
  cat(m,"\n")
}

# 90% Percentile Theory Confidence Intervals for DoM Replying at All Conservative-Control
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
doM.conservative.control.reply.low <- ordered.boot[50]
doM.conservative.control.reply.high <- ordered.boot[950]

# 90% Percentile Theory Confidence Interval Around Difference of Means, Conservative-Control Substantive Reply, overall sample
# Bootstrap: 1000 Estimates of Difference of Means, Conservative-Control Substantive Reply, Overall Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(roomdata_rand), replace = TRUE)
  dat.boot <- roomdata_rand[sel,]
  
  # T Test 
  testing <- t.test(dat.boot$substantive[dat.boot$condition == "Control"], dat.boot$substantive[dat.boot$condition == "Conservative"],
                    alternative = c("two.sided"))
  
  pp.boot[m] <- testing$estimate[1] - testing$estimate[2]
  
  cat(m,"\n")
}

# 90% Percentile Theory Confidence Intervals for DoM Substantive Reply Conservative-Control
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
doM.conservative.control.substantive.low <- ordered.boot[50]
doM.conservative.control.substantive.high <- ordered.boot[950]

# 90% Percentile Theory Confidence Interval Around Difference of Means, Conservative-Control Days to Reply, overall sample
# Bootstrap: 1000 Estimates of Difference of Means, Conservative-Control Days to Reply, Overall Sample
m <- 1
pp.boot <- rep(NA,1000)
set.seed(1)

for(m in 1:1000)	{
  
  # create bootstrap sample
  sel <- sample(1:nrow(roomdata_rand), replace = TRUE)
  dat.boot <- roomdata_rand[sel,]
  
  # T Test 
  testing <- t.test(dat.boot$days[dat.boot$condition == "Control"], dat.boot$days[dat.boot$condition == "Conservative"],
                    alternative = c("two.sided"))
  
  pp.boot[m] <- testing$estimate[1] - testing$estimate[2]
  
  cat(m,"\n")
}

# 90% Percentile Theory Confidence Intervals for DoM Days to Reply Conservative-Control
ordered.boot <- sort(pp.boot,  decreasing = FALSE)
doM.conservative.control.days.low <- ordered.boot[50]
doM.conservative.control.days.high <- ordered.boot[950]

# Table Displaying Difference of Means Drawn from Posterior Distribution at 5th and 9th Percentiles
# Balance Test/ Equivalency Check Tables- All Emails Sent
# Liberal- All Emails Sent 
library(Hmisc)
Comparison <- matrix(NA, 9, 2)
colnames(Comparison) <- c("5th Percentile", "95th Percentile")
rownames(Comparison) <- c("Liberal-Conservative, Reply",
                         "Liberal-Conservative, Substantive",
                         "Liberal-Conservative, Days to Reply",
                         
                         "Liberal-Control, Reply",
                         "Liberal-Control, Substantive",
                         "Liberal-Control, Days to Reply",
                         
                         "Conservative-Control, Reply",
                         "Conservative-Control, Substantive",
                         "Conservative-Control, Days to Reply")

Comparison[1,1] <- round(doM.liberal.conservative.reply.low, digits =2) 
Comparison[1,2] <- round(doM.liberal.conservative.reply.high, digits =2)
Comparison[2,1] <- round(doM.liberal.conservative.substantive.low, digits =2)
Comparison[2,2] <- round(doM.liberal.conservative.substantive.high, digits =2)
Comparison[3,1] <- round(doM.liberal.conservative.days.low, digits =2)
Comparison[3,2] <- round(doM.liberal.conservative.days.high, digits =2)
Comparison[4,1] <- round(doM.liberal.control.reply.low, digits =2)
Comparison[4,2] <- round(doM.liberal.control.reply.high, digits =2)
Comparison[5,1] <- round(doM.liberal.control.substantive.low, digits =2)
Comparison[5,2] <- round(doM.liberal.control.substantive.high, digits =2)
Comparison[6,1] <- round(doM.liberal.control.days.low, digits =2)
Comparison[6,2] <- round(doM.liberal.control.days.high, digits =2)
Comparison[7,1] <- round(doM.conservative.control.reply.low, digits =2)
Comparison[7,2] <- round(doM.conservative.control.reply.high, digits =2)
Comparison[8,1] <- round(doM.conservative.control.substantive.low, digits =2)
Comparison[8,2] <- round(doM.conservative.control.substantive.high, digits =2)
Comparison[9,1] <- round(doM.conservative.control.days.low, digits =2)
Comparison[9,2] <- round(doM.conservative.control.days.high, digits =2)

latex(Comparison, file = "")

Variables[ ,3] <- round(summary(control_balance)$coefficients[ ,4], digits = 2)



# Map Showing Geographic Coverage of Schools 
install.packages("usmap")
install.packages("scales")

AL <- length(grep("_AL", roomdata_rand$county))
AK <- length(grep("Alaska", roomdata_rand$county))
AZ <- length(grep("_AZ", roomdata_rand$county))
AR <- length(grep("_AR", roomdata_rand$county))
CA <- length(grep("_CA", roomdata_rand$county))
CO <- length(grep("_CO", roomdata_rand$county))
CT <- length(grep("_CT", roomdata_rand$county))
DE <- length(grep("_DE", roomdata_rand$county))
FL <- length(grep("_FL", roomdata_rand$county))
GA <- length(grep("_GA", roomdata_rand$county))
HI <- length(grep("_HI", roomdata_rand$county))
ID <- length(grep("_ID", roomdata_rand$county))
IL <- length(grep("_IL", roomdata_rand$county))
IN <- length(grep("_IN", roomdata_rand$county))
IA <- length(grep("_IA", roomdata_rand$county))
KS <- length(grep("_KS", roomdata_rand$county))
KY <- length(grep("_KY", roomdata_rand$county))
LA <- length(grep("_LA", roomdata_rand$county))
ME <- length(grep("_ME", roomdata_rand$county))
MD <- length(grep("_MD", roomdata_rand$county))
MA <- length(grep("_MA", roomdata_rand$county))
MI <- length(grep("_MI", roomdata_rand$county))
MN <- length(grep("_MN", roomdata_rand$county))
MS <- length(grep("_MS", roomdata_rand$county))
MO <- length(grep("_MO", roomdata_rand$county))
MT <- length(grep("_MT", roomdata_rand$county))
NE <- length(grep("_NE", roomdata_rand$county))
NV <- length(grep("_NV", roomdata_rand$county))
NH <- length(grep("_NH", roomdata_rand$county))
NJ <- length(grep("_NJ", roomdata_rand$county))
NM <- length(grep("_NM", roomdata_rand$county))
NY <- length(grep("_NY", roomdata_rand$county))
NC <- length(grep("_NC", roomdata_rand$county))
ND <- length(grep("_ND", roomdata_rand$county))
OH <- length(grep("_OH", roomdata_rand$county))
OK <- length(grep("_OK", roomdata_rand$county))
OR <- length(grep("_OR", roomdata_rand$county))
PA <- length(grep("_PA", roomdata_rand$county))
RI <- length(grep("_RI", roomdata_rand$county))
SC <- length(grep("_SC", roomdata_rand$county))
SD <- length(grep("_SD", roomdata_rand$county))
TN <- length(grep("_TN", roomdata_rand$county))
TX <- length(grep("_TX", roomdata_rand$county))
UT <- length(grep("_UT", roomdata_rand$county))
VT <- length(grep("_VT", roomdata_rand$county))
VA <- length(grep("_VA", roomdata_rand$county))
WA <- length(grep("_WA", roomdata_rand$county))
WV <- length(grep("_WV", roomdata_rand$county))
WI <- length(grep("_WI", roomdata_rand$county))
WY <- length(grep("_WY", roomdata_rand$county))

colleges <- c(AL, AK, AZ, AR, CA, CO, CT, DE, FL, 
            GA, HI, ID, IL, IN, IA, KS, KY, LA, 
            ME, MD, MA, MI, MN, MS, MO, MT, NE, 
            NV, NH, NJ, NM, NY, NC, ND, OH, OK, 
            OR, PA, RI, SC, SD, TN, TX, UT, VT, 
            VA, WA, WV, WI, WY)

collegetwo <- as.data.frame(colleges)
collegetwo$state <- NA 
collegetwo$state[1] <- "Alabama"
collegetwo$state[2] <- "Alaska"
collegetwo$state[3] <- "Arizona"
collegetwo$state[4] <- "Arkansas"
collegetwo$state[5] <- "California"
collegetwo$state[6] <- "Colorado"
collegetwo$state[7] <- "Connecticut"
collegetwo$state[8] <- "Delaware"
collegetwo$state[9] <- "Florida"
collegetwo$state[10] <- "Georgia"
collegetwo$state[11] <- "Hawaii"
collegetwo$state[12] <- "Idaho"
collegetwo$state[13] <- "Illinois"
collegetwo$state[14] <- "Indiana"
collegetwo$state[15] <- "Iowa"
collegetwo$state[16] <- "Kansas"
collegetwo$state[17] <- "Kentucky"
collegetwo$state[18] <- "Louisiana"
collegetwo$state[19] <- "Maine"
collegetwo$state[20] <- "Maryland"
collegetwo$state[21] <- "Massachusetts"
collegetwo$state[22] <- "Michigan"
collegetwo$state[23] <- "Minnesota"
collegetwo$state[24] <- "Mississippi"
collegetwo$state[25] <- "Missouri"
collegetwo$state[26] <- "Montana"
collegetwo$state[27] <- "Nebraska"
collegetwo$state[28] <- "Nevada"
collegetwo$state[29] <- "New Hampshire"
collegetwo$state[30] <- "New Jersey"
collegetwo$state[31] <- "New Mexico"
collegetwo$state[32] <- "New York"
collegetwo$state[33] <- "North Carolina"
collegetwo$state[34] <- "North Dakota"
collegetwo$state[35] <- "Ohio"
collegetwo$state[36] <- "Oklahoma"
collegetwo$state[37] <- "Oregon"
collegetwo$state[38] <- "Pennsylvania"
collegetwo$state[39] <- "Rhode Island"
collegetwo$state[40] <- "South Carolina"
collegetwo$state[41] <- "South Dakota"
collegetwo$state[42] <- "Tennessee"
collegetwo$state[43] <- "Texas"
collegetwo$state[44] <- "Utah"
collegetwo$state[45] <- "Vermont"
collegetwo$state[46] <- "Virginia"
collegetwo$state[47] <- "Washington"
collegetwo$state[48] <- "West Virginia"
collegetwo$state[49] <- "Wisconsin"
collegetwo$state[50] <- "Wyoming"

collegetwo <- read.csv("C:/Users/khanj/Desktop/publications/data/collegenumbersstudytwo.csv")

library(tidyverse)
library(usmap)
library(scales)

college_numbers_two_plot <- plot_usmap(
  data = collegetwo,
  values = 'colleges'
) +
  scale_fill_gradient(
    trans = 'log',
    labels = scales::label_number(big.mark = ','),
    breaks = c(1, 5, 10, 20, 30, 40, 50, 60, 100),
    high = '#0072B2',
    low = 'white'
  ) +
  theme(legend.position = 'top') +
  labs(fill = 'Number of Colleges') +
  guides(
    fill = guide_colorbar(
      barwidth = unit(10, 'cm')
    )
  )






